Responses 参数 类型 必填 说明 model string 是 模型调用名称 input string 或 array 是 模型输入。传字符串时等价于一条 roleuser 的纯文本消息;传数组时为输入条目列表,按顺序排列 input[].type string 否 输入条目类型:message、functioncall、functioncalloutput、reasoning、itemreference。默认 message input[].role string 否 角色:user、assistant、system、developer。type 为 message 时必填 input[].content string 或 array 否 消息内容。纯文本可直接传字符串;多模态需传内容数组 input[].content[].type string 是 内容类型:inputtext、inputimage、inputfile、inputaudio input[].content[].text string 否 输入文本。type 为 inputtext 时必填 input[].content[].imageurl string 否 图片地址,支持公网 URL 或 data:image/xxx;base64,... 。type 为 inputimage 时必填 input[].content[].detail string 否 图片解析精度:auto、low、high,默认 auto input[].content[].fileid string 否 已上传文件的 ID。type 为 inputfile 时与 fileurl 二选一 input[].content[].fileurl string 否 文件地址。type 为 inputfile 时与 fileid 二选一 input[].content[].filename string 否 文件名,便于模型识别文件类型 input[].content[].inputaudio object 否 音频输入。type 为 inputaudio 时必填 input[].content[].inputaudio.data string 是 音频数据,Base64 编码或可访问的音频 URL input[].content[].inputaudio.format string 是 音频格式,如 mp3、wav input[].callid string 否 工具调用 ID。type 为 functioncall、functioncalloutput 时必填 input[].name string 否 函数名。type 为 functioncall 时必填 input[].arguments string 否 函数入参,JSON 字符串。type 为 functioncall 时必填 input[].output string 否 工具执行结果,JSON 字符串。type 为 functioncalloutput 时必填 instructions string 否 插入模型上下文的系统(或开发者)消息。与 previousresponseid 一起使用时,上一次响应的 instructions 不会延续到本次请求,便于随时替换系统提示 previousresponseid string 否 上一次响应的 ID。传入后服务端自动拼接上一轮上下文,实现有状态多轮对话;不能与 conversation 同时使用 conversation string 或 object 否 关联的会话 ID。会话中的历史条目会自动拼接到本次输入前,本次输入与输出也会写回该会话;不能与 previousresponseid 同时使用 store boolean 否 是否存储本次响应以便后续通过 previousresponseid 检索,默认 true。设为 false 时为无状态调用,需自行回传全部历史条目 stream boolean 否 默认 false。true 开启流式输出,以 SSE 事件流增量返回,长文本建议开启,降低超时风险 streamoptions object 否 仅 streamtrue 生效 streamoptions.includeobfuscation boolean 否 是否在增量事件中加入混淆字段,默认 true;内网可信链路可设为 false 以减少带宽 maxoutputtokens integer 否 输出 Token 上限,包含可见输出与 reasoning tokens maxtoolcalls integer 否 单次响应中内置工具调用总次数上限,超出后的调用请求将被忽略 temperature float 否 取值 [0,2],控制随机性;越高越发散,越低越确定;建议和 topp 只设置其中一个 topp float 否 取值 (0,1.0],核采样;控制生成多样性 toplogprobs integer 否 取值 0~20,返回每个 Token 位置上概率最高的若干候选及其对数概率 tools array 否 模型可调用的工具列表,详见下方「工具参数」 toolchoice string 或 object 否 工具选择策略:auto(默认,由模型决定)、none(不调用工具)、required(必须调用至少一个工具),或指定具体工具 {"type":"function","name":"getweather"} paralleltoolcalls boolean 否 是否允许模型并行发起多个工具调用,默认 true reasoning object 否 推理模型配置 reasoning.effort string 否 推理强度:minimal、low、medium、high(部分模型支持 xhigh) reasoning.summary string 否 是否返回推理摘要:auto、concise、detailed text object 否 文本输出配置 text.format object 否 输出格式。 {"type":"text"} 为默认纯文本; {"type":"jsonschema","name":"...","schema":{...},"strict":true} 开启结构化 JSON 输出 text.verbosity string 否 输出详略程度:low、medium、high(部分模型支持) truncation string 否 上下文截断策略。auto:输入超出上下文窗口时从最早条目开始丢弃;disabled(默认):超出时直接返回 400 错误 metadata object 否 附加到响应的键值对,最多 16 对,键最长 64 字符,值最长 512 字符 user string 否 终端用户稳定标识,用于缓存分桶与风控;建议对用户名或邮箱做哈希,勿传原始个人信息 safetyidentifier string 否 更安全的终端用户标识,最长 64 字符,替代 user 字段 promptcachekey string 否 提示词缓存键,用于提升相似请求的缓存命中率,替代 user 字段 servicetier string 否 服务层级:auto、default、flex、priority(部分平台支持) background boolean 否 是否后台异步执行,默认 false。为 true 时立即返回响应 ID,可通过 GET /v1/responses/{responseid} 轮询状态;需 storetrue include array 否 指定响应中额外返回的字段,如 message.outputtext.logprobs 、 reasoning.encryptedcontent 、 filesearchcall.results 、 websearchcall.action.sources 、 codeinterpretercall.outputs
来自: