ChatOpenAI Compatible
ChatCompletions 格式
OpenAI Chat Completions 兼容接口。支持文本、多模态输入、工具调用和流式响应。
OpenAI Chat Completions 兼容接口。支持文本、多模态输入、工具调用和流式响应。
Authorization
bearerAuth AuthorizationBearer <token>
使用 Authorization Bearer API Key 进行鉴权。
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.4-nano", "messages": [ { "role": "user", "content": "Write a concise launch note." } ] }'{
"id": "chatcmpl_123",
"object": "chat.completion",
"created": 0,
"model": "string",
"choices": [
{
"index": 0,
"message": {
"role": "system",
"content": "string",
"name": "string",
"tool_call_id": "string",
"tool_calls": [
{}
]
},
"delta": {},
"finish_reason": "string"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}