创建模型响应
POST /v1/responses
说明
https://platform.openai.com/docs/api-reference/responses/create 部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest
概览
| Method | POST |
|---|---|
| Path | /v1/responses |
| Type | http |
| Status | 1 |
| Module | 2102810 |
| Folder | 62503105 |
参数
{ "query": [], "path": [], "cookie": [], "header": [ { "id": "NQs7bxnpZf", "name": "Content-Type", "required": true, "description": "", "type": "string", "enable": true, "sampleValue": "application/json" }, { "id": "qb8tEQbCty", "name": "Accept", "required": true, "description": "", "type": "string", "enable": true, "sampleValue": "application/json" }, { "required": false, "description": "", "type": "string", "id": "gBxcCbXhsa", "enable": true, "name": "Authorization", "sampleValue": "Bearer {{YOUR_API_KEY}}" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "model": { "type": "string", "description": "要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。" }, "input": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" } }, "x-apifox-orders": [ "role", "content" ] } } }, "x-apifox-orders": [ "model", "input" ] }, "required": false, "mediaType": "", "examples": [ { "value": "{\n \"model\": \"gpt-5.1\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a one-sentence bedtime story about a unicorn.\"\n }\n ]\n }", "mediaType": "application/json" } ], "oasExtensions": "" }
响应
[ { "id": 686628256, "name": "OK", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "created": { "type": "integer" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "message": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" } }, "required": [ "role", "content" ], "x-apifox-orders": [ "role", "content" ] }, "finish_reason": { "type": "string" } }, "x-apifox-orders": [ "index", "message", "finish_reason" ] } }, "usage": { "type": "object", "properties": { "prompt_tokens": { "type": "integer" }, "completion_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } }, "required": [ "prompt_tokens", "completion_tokens", "total_tokens" ], "x-apifox-orders": [ "prompt_tokens", "completion_tokens", "total_tokens" ] } }, "required": [ "id", "object", "created", "choices", "usage" ], "x-apifox-orders": [ "id", "object", "created", "choices", "usage" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [], "oasExtensions": "" } ]
响应示例
[ { "name": "OK", "responseId": 686628256, "data": "{\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1677652288,\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"\\n\\nHello there, how may I assist you today?\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 12,\n \"total_tokens\": 21\n }\n}", "description": "", "oasKey": "", "oasExtensions": "", "id": 596420910 } ]