GET
/v1/schemas/moonshotai-cn/chat/v1/responses?kind=output
Accept:
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source trace6b78ce0730900579f18d575e9c1c5ed3e34244ea683efa15cb57cee501201ddb{
"fetchedAt": 1791351145,
"extractorVersion": "1",
"verifiedAt": null
} |
Response body
26 properties · 0 required · 13 $defs| property | type | description | constraints |
|---|---|---|---|
| id | string | 响应的唯一标识符。 | |
| object | enum | response | |
| created_at | integer | 响应创建时的 Unix 时间戳。 | |
| completed_at | any | 响应结束时的 Unix 时间戳。`status` 为 `completed` 或 `incomplete` 时给出,为 `in_progress` 或 `failed` 时是 `null`。 | |
| status | enum | 响应状态。流式的起手快照为 `in_progress`。 | in_progress | completed | incomplete | failed |
| model | string | 产生本次响应的模型。 | |
| output | ResponsesOutputItem[] | 输出 item 数组,顺序为 web_search_call(如有)、reasoning、message、工具调用。 | |
| usage | ResponsesUsage | 本次响应的 Token 用量。 | nullable |
| incomplete_details | object | `status` 为 `incomplete` 时给出原因。 | |
| error | object | `status` 为 `failed` 时给出错误信息。 | |
| instructions | any | ||
| reasoning | any | ||
| text | any | ||
| tools | any | ||
| tool_choice | enum | 控制工具调用行为。取 `auto` 时由模型自行决定是否调用工具。 | auto · nullable |
| max_output_tokens | any | ||
| temperature | any | ||
| top_p | any | ||
| metadata | any | ||
| parallel_tool_calls | boolean | ||
| service_tier | any | ||
| store | boolean | 固定为 `false`。 | |
| background | any | 固定为 `false`。 | |
| previous_response_id | any | 固定为 `null`。 | |
| conversation | any | 固定为 `null`。 | |
| prompt_cache_options | object | 服务端实际应用的上下文缓存写入选项。当请求省略 prompt_cache_options 时,以此处返回的 mode 和 ttl 为准 |
Types
13 $defsResponsesCustomToolobject
接收自由文本输入的自定义工具。当前仅支持名为 `apply_patch` 的自定义工具,且必须提供 `grammar` + `lark` 格式定义;模型调用时在 output 中返回 `custom_tool_call` item。
| type* | enum | custom | |
| name* | enum | 工具名称,当前仅支持 `apply_patch`。 | apply_patch |
| description | string | ||
| format* | object | 输入格式约束。当前仅支持 `grammar` 类型与 `lark` 语法。 |
ResponsesFunctionToolobject
用 JSON Schema 描述参数的函数工具。
| type* | enum | function | |
| name* | string | 函数名称。必须符合正则表达式:^[a-zA-Z_][a-zA-Z0-9-_]{0,127}$ | |
| description | string | ||
| parameters | object | 描述函数参数的 JSON Schema。 | |
| strict | boolean |
ResponsesNamespaceToolobject
把一组函数工具或自定义工具收纳到同一个命名空间下。
| type* | enum | namespace | |
| name* | string | ||
| description* | string | ||
| tools* | ResponsesFunctionTool | ResponsesCustomTool[] |
ResponsesOutputCustomToolCallItemobject
模型发起的自定义工具调用。
| type | enum | custom_tool_call | |
| id | string | ||
| call_id | string | 回传结果时在 `custom_tool_call_output` 中使用该值。 | |
| name | string | ||
| namespace | string | 调用命名空间工具时返回。 | |
| input | string | 模型生成的自由文本输入。 | |
| status | enum | in_progress | completed |
ResponsesOutputFunctionCallItemobject
模型发起的函数调用。
| type | enum | function_call | |
| id | string | ||
| call_id | string | 回传结果时在 `function_call_output` 中使用该值。 | |
| name | string | ||
| namespace | string | 调用命名空间工具时返回。 | |
| arguments | string | 函数参数的 JSON 字符串。 | |
| status | enum | in_progress | completed |
ResponsesOutputItem推理 | 消息 | 函数调用 | …
output 数组的元素,按 `type` 区分。
ResponsesOutputMessageItemobject
模型的文本回复。
| type | enum | message | |
| id | string | ||
| role | enum | assistant | |
| content | object[] | ||
| status | enum | in_progress | completed |
ResponsesOutputReasoningItemobject
模型的推理内容。
| type | enum | reasoning | |
| id | string | ||
| summary | object[] | 推理内容。 | |
| encrypted_content | any | 固定为 `null`。 | |
| status | enum | in_progress | completed |
ResponsesOutputWebSearchCallItemobject
服务端执行的联网搜索调用。仅在请求包含 `web_search` 工具且服务端判断需要搜索时返回,位于 output 数组最前面。
| type | enum | web_search_call | |
| id | string | ||
| status | enum | in_progress | completed | |
| action | object | 本次搜索的动作。 | |
| results | object[] | 图片搜索结果。仅在 `include` 包含 `web_search_call.results` 且 `search_content_types` 包含 `image` 时返回。 |
ResponsesTool函数工具 | 自定义工具 | 命名空间工具 | …
工具定义,按 `type` 区分。支持 `function`、`custom`(仅 `apply_patch`)、`namespace` 与 `web_search`,其他工具类型不支持。
ResponsesToolChoiceenum
控制工具调用行为。取 `auto` 时由模型自行决定是否调用工具。
auto
ResponsesUsageobject
本次响应的 Token 用量。
| input_tokens | integer | 输入 Token 数量,含命中缓存的部分。 | |
| input_tokens_details | object | ||
| output_tokens | integer | 输出 Token 数量,含推理 Token。 | |
| output_tokens_details | object | ||
| total_tokens | integer | 总 Token 数量。 |
ResponsesWebSearchToolobject
由服务端执行的联网搜索工具。加入后服务端会先根据输入判断是否需要搜索;需要时执行搜索并把结果注入模型上下文,同时在 output 中返回一个 `web_search_call` item。每个请求最多包含一个 `web_search` 工具。`search_context_size`、`blocked_domains`、`filters.blocked_domains` 不支持,传入会返回 `invalid_request_error`;`user_location`、`external_web_access`、`…
| type* | enum | web_search | |
| filters | object | 搜索范围过滤。 | |
| search_content_types | enum[] | 搜索结果类型,默认仅 `text`。包含 `image` 时会额外执行图片搜索。 | default: ["text"] |
| image_settings | object | 图片搜索设置,仅在 `search_content_types` 包含 `image` 时生效。 |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"moonshotai-cn","endpointId":"v1/responses","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}