POST /v1/responses
Responses API 兼容 OpenAI Responses API 格式。相较于 Chat Completions,提供内置工具(联网搜索、代码解释器等)、更灵活的输入格式和简化的多轮上下文管理。使用 OpenAI SDK 的 client.responses.create() 即可调用。
请求端点 POST https://nexusflow.hk/v1/responses
请求参数 参数 类型 必选 说明 modelstring * 模型名称,如 qwen3.7-plus、qwen3.7-max 等 inputstring | array * 纯文本或消息数组(支持 role: user/assistant/system/developer) instructionsstring - 系统指令,插入上下文起始位置 previous_response_idstring - 上一轮响应 ID(有效期 7 天),用于多轮对话 streamboolean - 是否开启流式输出,默认 false storeboolean - 是否存储响应(默认 true),false 则不能用 previous_response_id 引用 toolsarray - 工具列表:web_search、web_extractor、code_interpreter、function 等 tool_choicestring | object - 工具选择策略:auto / none / required temperaturefloat - 采样温度,取值 [0, 2) top_pfloat - 核采样概率阈值,取值 (0, 1] enable_thinkingboolean - 是否开启思考模式 reasoningobject - 思考强度控制,如 {effort: "high"}
代码示例 基本调用 流式输出 内置工具 多轮对话 Function Call
cURL Python Node.js
复制 curl https://nexusflow.hk/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-plus",
"input": "你好!"
}'内置工具 建议同时开启 web_search、web_extractor 和 code_interpreter 以获得最佳效果。
工具类型 说明 web_search联网搜索,获取最新互联网信息 web_extractor网页抓取,提取网页内容(需配合 web_search) code_interpreter代码解释器,执行代码并返回结果 web_search_image文搜图,根据文本描述搜索图片 image_search图搜图,根据图片搜索相似图片 file_search知识库搜索,检索已上传的知识库 function自定义函数工具,模型决定调用时返回 function_call
响应格式 非流式请求返回完整的 JSON 对象,object 字段值为 "response"。流式请求返回 SSE 事件流,以 response.completed 事件结束。
字段 类型 说明 idstring 响应唯一标识(UUID 格式),有效期 7 天,可用作 previous_response_id objectstring 固定为 "response" statusstring completed / failed / in_progress / cancelled modelstring 实际使用的模型 ID outputarray 输出项数组:message / reasoning / function_call / web_search_call 等 usageobject Token 消耗:input_tokens、output_tokens、total_tokens、input_tokens_details、output_tokens_details
辅助端点 方法 端点 说明 GET /v1/responses/{id}检索已存储的响应(需 store=true) DELETE /v1/responses/{id}删除已存储的响应 GET /v1/responses/{id}/input_items获取生成响应时使用的输入项列表
支持的模型 当前 Responses API 支持通义千问系列模型:qwen3.7-max、qwen3.7-plus、qwen3.6-plus、qwen3.5-plus、qwen3.5-flash、qwen3.6-flash、qwen-plus、qwen-flash、qwen3-coder-plus、qwen3-coder-flash 等。
注意事项
previous_response_id 关联的响应有效期为 7 天。建议同时开启内置工具(web_search + web_extractor + code_interpreter)以获得最佳效果。 设置 store: false 时响应不会被存储,无法被后续引用。 流式输出的最终 response.completed 事件包含完整的 usage 信息。