mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 18:05:48 +03:00
[GH-ISSUE #327] cc接入openai custom报错,请帮忙看看 #234
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#234
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tint0ri on GitHub (Feb 14, 2026).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/327
走openai协议没有问题
curl http://192.168.191.141:8998/openai-custom/v1/chat/completions
-H "Content-Type: application/json"
-H "X-API-Key: 。。。"
-d '{
"model": "openailike",
"max_tokens": 1000,
"messages": [{"role": "user", "content": "Hello!"}]
}'
走claude协议报错: {"type":"error","error":{"type":"invalid_request_error","message":"Request failed with status code 400"}}
curl http://192.168.191.141:8998/openai-custom/v1/messages
-H "Content-Type: application/json"
-H "X-API-Key: 。。。"
-d '{
"model": "openailike",
"max_tokens": 1000,
"messages": [{"role": "user", "content": "你好!"}]
}'
日志:
[2026-02-14 11:24:28.929] [Req:01880759] [ERROR] [OpenAI API] Error calling API (Status: 400, Code: ERR_BAD_REQUEST): { "error": { "message": "field messages is required (request id: 2026021419242851292088992257311)", "type": "one_api_error", "param": "", "code": "invalid_text_request" } }
[2026-02-14 11:24:28.929] [Req:01880759] [ERROR] [Server] Error during unary processing: AxiosError: Request failed with status code 400 at settle (file:///app/node_modules/axios/lib/core/settle.js:19:12) at IncomingMessage.handleStreamEnd (file:///app/node_modules/axios/lib/adapters/http.js:599:11) at IncomingMessage.emit (node:events:536:35) at endReadableNT (node:internal/streams/readable:1698:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) at Axios.request (file:///app/node_modules/axios/lib/core/Axios.js:45:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async OpenAIApiService.callApi (file:///app/src/providers/openai/openai-core.js:60:30) at async handleUnaryRequest (file:///app/src/utils/common.js:640:32) at async handleUnaryRequest (file:///app/src/utils/common.js:741:28) at async handleUnaryRequest (file:///app/src/utils/common.js:741:28) at async handleUnaryRequest (file:///app/src/utils/common.js:741:28) at async handleUnaryRequest (file:///app/src/utils/common.js:741:28) at async handleUnaryRequest (file:///app/src/utils/common.js:741:28) at async handleContentGenerationRequest (file:///app/src/utils/common.js:928:9)
@justlovemaki commented on GitHub (Feb 14, 2026):
one_api_error
你都用oneapi了,再转一道干嘛呢?
@Tint0ri commented on GitHub (Feb 15, 2026):
目标是CC接入OpenAI协议的模型。需要协议转换。CC直接用也是报错。