You need to enable JavaScript to run this app.
文档中心
火山方舟

火山方舟

复制全文
下载 pdf
Responses API
创建 Response
复制全文
下载 pdf
创建 Response
POST https://ark.cn-beijing.volces.com/api/v3/responses​
通过 Responses API 创建一个 Response,本文介绍接口的输入输出参数。​
鉴权​
本接口支持鉴权方式如下,详情请参见 Base URL 及鉴权。​
  • API Key 鉴权,请在 API Key 管理 页面,获取长效 API Key。​
​​
请求参数​
Header 参数​
在 HTTP 请求头中传入。​
X-Fornax-Trace string | 开启数据上报​
​
​
Body 参数​
input string / object[] 必选 | 输入内容​
​
model string 必选 | 模型 ID​
​
caching object | 上下文缓存​
​
context_management object | 上下文管理​
​
expire_at integer | 过期时间戳​
​
include string[] | 附加输出数据​
​
instructions string | 系统指令​
​
max_output_tokens integer | 最大输出长度​
​
max_tool_calls integer | 最大调用轮次​
​
metadata object | 自定义元数据​
​
previous_response_id string | 上轮响应 ID​
​
prompt_cache_key string | 缓存路由标识​
​
reasoning object | 思考工作量​
​
service_tier string | 推理模式​
​
store boolean 默认值 true | 存储响应​
​
stream boolean 默认值 false | 流式输出​
​
temperature number 默认值 1.0 | 采样温度​
​
text object | 输出格式​
​
thinking object | 深度思考开关​
​
tool_choice string / object | 工具调用策略​
​
tools object[] | 工具列表​
​
top_p number 默认值 0.7 | 核采样阈值​
​
​
响应参数​
非流式调用响应。​
created_at integer | 创建时间戳​
​
id string | 响应 ID​
​
model string | 模型 ID​
​
object string | 对象类型​
​
output object[] | 输出条目​
​
caching object | 上下文缓存​
​
context_management object | 上下文管理​
​
error object | 响应错误​
​
expire_at integer | 过期时间戳​
​
incomplete_details object | 未完成详情​
​
instructions string | 系统指令​
​
max_output_tokens integer | 最大输出长度​
​
max_tool_calls integer | 最大调用轮次​
​
metadata object | 自定义元数据​
​
previous_response_id string | 上轮响应 ID​
​
reasoning object | 思考工作量​
​
service_tier string | 推理模式​
​
status string | 响应状态​
​
store boolean | 存储响应​
​
temperature number | 采样温度​
​
text object | 输出格式​
​
thinking object | 深度思考配置​
​
tool_choice string / object | 工具调用策略​
​
tools object[] | 工具列表​
​
top_p number | 核采样阈值​
​
usage object | Token 用量​
​
​
Response 生命周期事件。​
字段结构详见 Response 生命周期。​
语音转写与错误事件。​
字段结构详见 语音转写与错误事件。​
Output Item 与文本回答。​
字段结构详见 Output Item 与文本回答。​
工具调用事件。​
字段结构详见 工具调用事件。​
​

Request

curl --location "https://ark.cn-beijing.volces.com/api/v3/responses" \
--header "Authorization: Bearer $ARK_API_KEY" \
--header "Content-Type: application/json" \
--data '{
    "model": "doubao-seed-2-1-pro-260915",
    "input": "你好呀。"
}'

Response

{
  "id": "resp_0217****",
  "created_at": 1756280722.0,
  "error": null,
  "incomplete_details": null,
  "instructions": null,
  "model": "doubao-seed-2-1-pro-260915",
  "object": "response",
  "output": [
    {
      "id": "rs_0217****404a",
      "summary": [
        {
          "text": "\n用户说“你好呀。”,这是一个很友好的问候,我需要用同样友好的方式回应。首先,应该回应用户的问候,然后可以表达一下愿意帮助的态度,让对话能够继续下去。用户可能接下来会有其他问题或者想聊聊天,所以回应要自然、亲切。\n\n首先,直接回“你好呀!”来呼应对方的问候,保持一致的语气。然后加上一句“很高兴见到你~ 有什么我可以帮你的吗?”这样既表达了友好,又主动提供帮助,让用户知道我在这里可以协助他们。这样的回应比较温暖,也符合日常交流的习惯,不会显得太生硬。\n\n需要注意的是,用户可能只是想打个招呼,所以回应不要太复杂,保持简洁和亲切就好。避免使用太正式的语言,保持口语化,让用户感觉舒适。总结一下,回应应该包含问候、表达高兴见到对方,以及提供帮助的意愿。",
          "type": "summary_text"
        }
      ],
      "type": "reasoning",
      "status": "completed"
    },
    {
      "id": "msg_0217****a93c",
      "content": [
        {
          "text": "你好呀!很高兴见到你~ 有什么我可以帮你的吗? 😊",
          "type": "output_text",
          "annotations": null
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "parallel_tool_calls": null,
  "temperature": null,
  "tool_choice": null,
  "tools": null,
  "top_p": null,
  "max_output_tokens": 32768,
  "previous_response_id": null,
  "thinking": null,
  "service_tier": "default",
  "status": "completed",
  "text": null,
  "usage": {
    "input_tokens": 88,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 230,
    "output_tokens_details": {
      "reasoning_tokens": 211
    },
    "total_tokens": 318
  },
  "caching": {
    "type": "disabled"
  },
  "store": true,
  "expire_at": 1756539922
}
最近更新时间:2026.10.28 20:32:45
这个页面对您有帮助吗?
有用
有用
无用
无用