Responses格式
Last updated: Nov 4, 2026
POST
OpenAI Responses API,用于创建模型响应。支持多轮对话、工具调用、推理等功能。
BearerAuthheader
AuthorizationBearer <token>使用 API Key 认证,格式:Authorization: Bearer <token>。
application/json- body
model*string模型 ID。
input?|array<>输入内容,可以是字符串或消息数组。
instructions?string系统指令(相当于 ChatCompletions 中的 system 消息)。
max_output_tokens?integer最大输出 Token 数。
temperature?number采样温度。
top_p?number核采样参数。
stream?boolean是否流式响应。
tools?array<>工具定义。
tool_choice?|工具选择策略。
reasoning?推理配置。
previous_response_id?string上一轮响应 ID,用于衔接多轮对话上下文。
truncation?string截断策略。
Value in
"auto""disabled"成功创建响应
application/json- response
id?string响应 ID。
object?string对象类型。
created_at?integer创建时间,Unix 时间戳(秒)。
status?string响应状态。
model?string实际使用的模型 ID。
output?array<>输出项列表。
usage?Token 用量统计。
curl -X POST 'https://vod.gz.baidubce.com/v1/responses' \ -H 'Content-Type: application/json' \ -d '{ "model": "kimi-k3"}'Example Response200
{ "id": "string", "object": "string", "created_at": 0, "status": "string", "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 } }}
