不喜欢 one/new-api 复杂的功能,自己撸了一个纯使用 yaml 配置文件部署的 api 中转项目 uni-api,没有前端,可能后面会补上,合适程序员使用:
今天的 API 就是用我写的项目部署的。希望兄弟们小手点点 star
。
目前还是项目初期,都是最有用的功能:
-
目前支持 gpt claude Gemini 转 gpt 格式
-
并支持图片
-
轮训(负载均衡)。
特此上贡 900 美元 API,邀请兄弟们给我项目压测或者提提意见,明天过期。
api:sk-DfSXcY_IrVavZ84xIeWbGPlj-zbLd3JxmvB44RfO5q0
base_url: https://api.0okm9ijn.xyz/v1/chat/completions
目前支持模型有:claude-3-5-sonnet-20240620
,gpt-4o
,claude-3-opus-20240229
。
36 个赞
ehzyil
(ehzyil)
6
轮询?
还有这种要求的啊? 可惜我最近都在用fuclaude 
能不能来点真的东西?
curl --location 'https://api.0okm9ijn.xyz/v1/chat/completions' \completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-DfSXcY_IrVavZ84xIeWbGPlj-zbLd3JxmvB44RfO5q0' \
--data '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Whats the weather like in Boston today?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}'
4 个赞
谢谢测试,已收到边缘用例,API是支持 tool use 的,但是不支持
“unit”: {
“type”: “string”,
“enum”: [“celsius”, “fahrenheit”]
}
上面这个语法,实测把上面删掉就可以用。
tahr
(tahr)
12
嗯嗯,听说过,我喜欢自己造轮子,就自己写了一个。哈哈。litellm 如果有什么你喜欢的功能,也可以告诉我,我帮你开发一下。
ruiw
(ruiw)
16
支持aws claude 的function calling吗
没实际测试过,你可以试试。如果不支持,我帮你适配一下。
waqian
(Lao Qian)
19
lobeChat 插件(搜索)GPT-4o fuction call:
“error”: {
“code”: “bad_response_status_code”,
“message”: “Provider API error: bad response status code 500 (request id: 20240718173017120047183WaYOPQKs)”,
“param”: “500”,
“type”: “upstream_error”
我刚刚测试了一下是能用的。是不是 url 填错了。