API 文档AI 模型接口聊天OpenAI
Responses格式
OpenAI Responses API,用于创建模型响应。
Responses格式
OpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
Base URL
https://autorouter.top— Production
Authentication
BearerAuth: http (bearer)
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
Endpoints
POST /v1/responses
Responses格式
OpenAI Responses API,用于创建模型响应。 支持多轮对话、工具调用、推理等功能。
Request Body
Content-Type: application/json
Example:
{
"model": "gpt-5.4-nano",
"input": "你好"
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | 模型 ID |
input | string | Yes | 输入内容。也可以是消息对象数组,用于多轮对话。 |
instructions | string | No | - |
max_output_tokens | integer | No | - |
temperature | number | No | - |
top_p | number | No | - |
stream | boolean | No | - |
tools | array | No | - |
tool_choice | string | No | 工具选择模式。也可以是对象以指定特定函数。 |
reasoning | object | No | - |
previous_response_id | string | No | - |
truncation | string | No | - |
Responses
200: 成功创建响应
Content-Type: application/json
请求示例
curl -X POST "https://autorouter.top/v1/responses" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4-nano",
"input": "你好"
}'响应示例
{
"id": "string",
"object": "response",
"created_at": 0,
"status": "completed",
"model": "string",
"output": [
{
"type": "string",
"id": "string",
"status": "string",
"role": "string",
"content": [
{
"type": "string",
"text": "string"
}
]
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0
}
}
}