Responses 格式
- 使用 OpenAI Responses 结构,是 Chat Completions 之外的另一种形态
- 内置工具(网页搜索、文件检索、代码执行)由服务端直接编排
- 支持跨轮次保留上下文,不必自己重发历史
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY请求参数
模型 ID。
输入内容。可以是纯字符串,也可以是消息数组。
消息角色,取值 user、assistant、system、developer。
消息正文。传数组时元素含 type,可混排文本与图片。
系统级指令。相当于把 system 提示提到顶层,优先级高于 input 里的内容。
输出 token 上限。注意这里带 output,与 Chat Completions 的 max_tokens 不同。
采样温度。
核采样阈值。
内置工具清单。支持 web_search_preview、file_search、code_interpreter 等类型。
工具类型标识。
工具选择策略,取值 auto、required 或 none。
上一轮响应的 ID。传入后服务端会自动带上历史上下文,不必重发 messages。
是否在服务端保留这次响应,供后续用 previous_response_id 引用。
是否流式返回。流式下事件类型与 Chat Completions 不同,按事件名区分。
结构化输出格式,json_schema 时需同时给 schema。
推理强度,取值 low、medium、high。仅推理模型支持。
The model ID.
The input. Can be a plain string or an array of messages.
The message role: user, assistant, system, or developer.
The message body. When passing an array, elements have a type and can mix text with images.
System-level instructions. Equivalent to lifting the system prompt to the top level; takes precedence over content in input.
The output token limit. Note the output in the name — different from Chat Completions' max_tokens.
Sampling temperature.
Nucleus sampling threshold.
The list of built-in tools. Supports types such as web_search_preview, file_search, and code_interpreter.
The tool type identifier.
The tool selection strategy: auto, required, or none.
The ID of the previous response. When passed, the server carries the earlier context automatically and you don't resend messages.
Whether to keep this response server-side so later requests can reference it via previous_response_id.
Whether to stream. In streaming mode the event types differ from Chat Completions; distinguish them by event name.
The structured output format; with json_schema you must also provide schema.
Reasoning effort: low, medium, or high. Supported only by reasoning models.
响应
响应 ID,形如 resp_。可作为下一轮的 previous_response_id。
固定为 response。
状态。completed 正常结束,incomplete 未完成,failed 失败。
输出项数组。元素类型可能是 message、web_search_call、reasoning 等。
输出项类型。
type 为 message 时的内容数组,元素含 type: output_text 与 text。
输入 token 数。
输出 token 数。
两者之和。
The response ID, in the form resp_. Can be used as the next turn's previous_response_id.
Always response.
The status. completed is a normal finish, incomplete means unfinished, failed means it failed.
The array of output items. Element types may include message, web_search_call, reasoning, and others.
The output item type.
The content array when type is message; elements have type: output_text and text.
Input token count.
Output token count.
The sum of both.
与 Chat Completions 的差异
| Chat Completions | Responses |
|---|---|
messages | input |
max_tokens | max_output_tokens |
| 无状态,每轮重发历史 | previous_response_id 承接上下文 |
工具调用返回 tool_calls | 工具结果直接内联在 output 里 |
choices[].message.content | output[].content[].text |
两者返回结构差别较大。如果现有代码是按 choices[0].message.content 解析的,切到 Responses 需要改解析逻辑。
| Chat Completions | Responses |
|---|---|
messages | input |
max_tokens | max_output_tokens |
| Stateless; resend history each turn | previous_response_id carries context |
Tool calls return tool_calls | Tool results are inlined in output |
choices[].message.content | output[].content[].text |
The response structures differ substantially. If your existing code parses choices[0].message.content, switching to Responses means changing the parsing logic.
支持的模型列表
以下模型均可通过本接口调用,清单由模型目录自动生成,实际可用范围以你的账号分组为准:
OpenAI 系列
gpt-6.1-sol旗舰,长上下文与复杂任务gpt-6.1-terra同代均衡版本gpt-6-luna低延迟,适合高并发gpt-5.3-codex代码专用 等
Anthropic 系列
claude-opus-5-5旗舰,长程任务与复杂推理claude-sonnet-5-5主力,能力与成本平衡claude-haiku-5-5轻量,响应最快claude-fable-5-1创作向 等
Google 系列
gemini-4-argon旗舰,多模态gemini-3.8-flash主力,速度快gemini-3.5-flash-lite轻量,批量任务gemini-3-pro-image图像生成 等
DeepSeek 系列
deepseek-v4-pro旗舰,推理强deepseek-v4.1-flash轻量,成本最低 等
xAI 系列
grok-4.7旗舰grok-4.5上一代,仍在维护 等
Moonshot AI 系列
kimi-k3.1-pro旗舰,超长上下文kimi-k3主力kimi-k2.7-code代码专用 等
智谱 / Z.AI 系列
glm-5.3旗舰glm-5.3-flash轻量 等
Alibaba 系列
qwen3.8-max旗舰qwen3.8-flash轻量 等
MiniMax 系列
MiniMax-M3旗舰minimax-m3.1-flash轻量 等
Midjourney 系列
Midjourney 走操作型接口,模型只有一档,具体动作(放大、扩图、变体等)见图像系列文档。
OpenAI 图像 系列
gpt-image-2.5-flare最新一代,支持参考图编辑gpt-image-2上一代主力gpt-image-1.5轻量,出图快gpt-image-1-mini成本最低 等
Google 图像 系列
gemini-3-pro-image旗舰,4K 输出与文字渲染强gemini-3.1-flash-image轻量,适合批量 等
Seedream 系列
seedream-5.0-pro旗舰,画质与文字准确度最好seedream-5.0-flash轻量,出图快 等
Seedance 系列
seedance-2.5旗舰,支持音画同步seedance-2.0上一代主力seedance-2.0-fast快速版seedance-2.0-mini轻量,成本最低 等
OpenAI 语音 系列
tts-1-hd语音合成,音质优先tts-1语音合成,延迟优先gpt-4o-mini-tts新一代,支持风格指令whisper-1语音转文字 等
Google 语音 系列
gemini-3.1-flash-tts-preview轻量语音合成,多语言 等
更多模型持续更新中…
GET /api/pricing。The models below can all be called through this endpoint. The list is generated from the model catalog; what your account group actually allows takes precedence:
OpenAI 系列
gpt-6.1-sol旗舰,长上下文与复杂任务gpt-6.1-terra同代均衡版本gpt-6-luna低延迟,适合高并发gpt-5.3-codex代码专用 等
Anthropic 系列
claude-opus-5-5旗舰,长程任务与复杂推理claude-sonnet-5-5主力,能力与成本平衡claude-haiku-5-5轻量,响应最快claude-fable-5-1创作向 等
Google 系列
gemini-4-argon旗舰,多模态gemini-3.8-flash主力,速度快gemini-3.5-flash-lite轻量,批量任务gemini-3-pro-image图像生成 等
DeepSeek 系列
deepseek-v4-pro旗舰,推理强deepseek-v4.1-flash轻量,成本最低 等
xAI 系列
grok-4.7旗舰grok-4.5上一代,仍在维护 等
Moonshot AI 系列
kimi-k3.1-pro旗舰,超长上下文kimi-k3主力kimi-k2.7-code代码专用 等
智谱 / Z.AI 系列
glm-5.3旗舰glm-5.3-flash轻量 等
Alibaba 系列
qwen3.8-max旗舰qwen3.8-flash轻量 等
MiniMax 系列
MiniMax-M3旗舰minimax-m3.1-flash轻量 等
Midjourney 系列
Midjourney 走操作型接口,模型只有一档,具体动作(放大、扩图、变体等)见图像系列文档。
OpenAI 图像 系列
gpt-image-2.5-flare最新一代,支持参考图编辑gpt-image-2上一代主力gpt-image-1.5轻量,出图快gpt-image-1-mini成本最低 等
Google 图像 系列
gemini-3-pro-image旗舰,4K 输出与文字渲染强gemini-3.1-flash-image轻量,适合批量 等
Seedream 系列
seedream-5.0-pro旗舰,画质与文字准确度最好seedream-5.0-flash轻量,出图快 等
Seedance 系列
seedance-2.5旗舰,支持音画同步seedance-2.0上一代主力seedance-2.0-fast快速版seedance-2.0-mini轻量,成本最低 等
OpenAI 语音 系列
tts-1-hd语音合成,音质优先tts-1语音合成,延迟优先gpt-4o-mini-tts新一代,支持风格指令whisper-1语音转文字 等
Google 语音 系列
gemini-3.1-flash-tts-preview轻量语音合成,多语言 等
更多模型持续更新中…
GET /api/pricing directly.错误码
For error response formats, status codes, and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
基础对话
输入放在 input 字段,可以是纯文本字符串,也可以是消息数组。返回的正文在 output[].content[].text 里。
系统提示词
用 instructions 字段设定角色与约束,位置在顶层,和 input 平级。
多轮对话
两种方式承接上下文:传 previous_response_id 让服务端接上文的 id,或者把完整历史数组放进 input。前者省 token,后者更可控。
结构化输出
text.format 指定返回 JSON,配合 schema 约束字段。适合需要严格字段名的解析场景。
内置工具
可以挂载 web_search 这类服务端工具,模型会自行调用并把结果并进回答,不需要自己写函数。
Basic chat
Input goes in the input field, either as a plain text string or a message array. The reply text is in output[].content[].text.
System prompt
Use the instructions field to set role and constraints; it sits at the top level, alongside input.
Multi-turn chat
Two ways to carry context: pass previous_response_id to let the server link to the earlier response by ID, or put the full history array into input. The former saves tokens; the latter gives more control.
Structured output
text.format asks for JSON, with schema constraining the fields. Useful for parsing scenarios that need strict field names.
Built-in tools
You can attach server-side tools like web_search; the model calls them itself and folds the results into the answer, with no function code of your own.