curl --request POST \
--url https://open.bigmodel.cn/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"input": "用一句话介绍智谱 GLM。"
}
'{
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"status": "completed",
"temperature": 123,
"top_p": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
}
},
"required": [
"city"
]
}
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "<string>"
},
"output": [
{
"type": "message",
"role": "assistant",
"status": "<string>",
"id": "<string>",
"content": {
"type": "output_text",
"text": "<string>"
}
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}创建 Response
创建一次模型响应。input 支持文本、图片和文件,可选流式、工具与多轮。详见 Response API。点击 Try it 可试用。
curl --request POST \
--url https://open.bigmodel.cn/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"input": "用一句话介绍智谱 GLM。"
}
'{
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"status": "completed",
"temperature": 123,
"top_p": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
}
},
"required": [
"city"
]
}
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "<string>"
},
"output": [
{
"type": "message",
"role": "assistant",
"status": "<string>",
"id": "<string>",
"content": {
"type": "output_text",
"text": "<string>"
}
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Body
模型编码。例如 glm-5.3。
"glm-5.3"
用户文本,或输入项数组(message / function_call / function_call_output / reasoning)。
系统指令。
是否 SSE 流式返回,默认 false。结束时不发送 data: [DONE]。
采样温度 [0.0, 1.0],限两位小数。GLM-5.3 默认 1.0。不要与 top_p 同时调节。
0 <= x <= 1核采样 [0.01, 1.0],限两位小数。GLM-5.3 默认 0.95。不要与 temperature 同时调节。
0.01 <= x <= 1模型输出最大 tokens(含回答与思维链)。最大 131072,默认 65536。
1 <= x <= 131072遇到其中任一字符串时停止生成。
["stop_word1"]
可调用工具:function / namespace / custom / web_search。
- 函数工具
- 命名空间工具
- 自定义工具
- 联网搜索
Show child attributes
Show child attributes
none 不调用任何工具;auto 由模型判断。
none, auto 限制深度思考的工作量。
Show child attributes
Show child attributes
模型文本输出格式,可以是自然语言或结构化 JSON。
Show child attributes
Show child attributes
用于集群路由,以提高缓存命中率。
上一轮 id,用于多轮。须 store=true,有效期 7 天。
是否保存本次响应,默认 false。为 true 时可用于查询、删除和多轮。
Response
同步返回 Response 对象;stream=true 时返回 SSE 事件流,不发送 data: [DONE]。
同步请求返回的 Response 对象。
本次请求的唯一标识。
固定为 response。
response 请求创建时间,Unix 秒时间戳。
模型名称。
系统指令。
模型输出最大 token 数,包含回答和思维链。
生成状态。
completed, failed, in_progress, incomplete 采样温度。
核采样概率阈值。
模型文本输出格式,可以是自然语言或结构化 JSON。
Show child attributes
Show child attributes
同入参 tools。
- 函数工具
- 命名空间工具
- 自定义工具
- 联网搜索
Show child attributes
Show child attributes
模型未能生成响应时的错误对象。
Show child attributes
Show child attributes
响应未能完成的细节。
Show child attributes
Show child attributes
本轮输出:回答、思维链、工具调用、联网搜索。
- 助手回答
- 思维链输出
- 函数调用
- 联网搜索调用
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?