Authorizations
使用以下格式进行身份验证:Bearer <your api key>
Body
application/json
🚀 GLM-4.6 代码编程专享计划 • 限时优惠 Coding Plan ➞
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/v3/application/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"app_id": "<string>",
"conversation_id": "<string>",
"third_request_id": "<string>",
"stream": true,
"messages": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
],
"role": "<string>",
"send_log_event": true
}'
{
"request_id": "<string>",
"conversation_id": "<string>",
"app_id": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"error_msg": {
"code": 123,
"msg": "<string>"
},
"delta": {
"content": {
"msg": "<string>",
"type": "<string>",
"code": "<string>",
"file": "<string>",
"url": "<string>",
"coverUrl": "<string>"
},
"event": {
"node_id": "<string>",
"node_name": "<string>",
"type": "<string>",
"content": "<string>",
"time": 123,
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
},
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
},
"messages": {
"content": {
"msg": "<string>",
"type": "<string>",
"code": "<string>",
"file": "<string>",
"url": "<string>",
"coverUrl": "<string>"
},
"event": [
{
"node_id": "<string>",
"node_name": "<string>",
"type": "<string>",
"content": "<string>",
"time": 123,
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
}
]
}
}
],
"usage": [
{
"model": "<string>",
"nodeName": "<string>",
"inputTokenCount": 123,
"outputTokenCount": 123,
"totalTokenCount": 123
}
]
}
对话型或文本型应用推理接口,支持同步和流式SSE
调用。
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/v3/application/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"app_id": "<string>",
"conversation_id": "<string>",
"third_request_id": "<string>",
"stream": true,
"messages": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"value": "<string>",
"key": "<string>"
}
]
}
],
"role": "<string>",
"send_log_event": true
}'
{
"request_id": "<string>",
"conversation_id": "<string>",
"app_id": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"error_msg": {
"code": 123,
"msg": "<string>"
},
"delta": {
"content": {
"msg": "<string>",
"type": "<string>",
"code": "<string>",
"file": "<string>",
"url": "<string>",
"coverUrl": "<string>"
},
"event": {
"node_id": "<string>",
"node_name": "<string>",
"type": "<string>",
"content": "<string>",
"time": 123,
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
},
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
},
"messages": {
"content": {
"msg": "<string>",
"type": "<string>",
"code": "<string>",
"file": "<string>",
"url": "<string>",
"coverUrl": "<string>"
},
"event": [
{
"node_id": "<string>",
"node_name": "<string>",
"type": "<string>",
"content": "<string>",
"time": 123,
"tool_calls": {
"type": "<string>",
"tool_calls_data": {}
}
}
]
}
}
],
"usage": [
{
"model": "<string>",
"nodeName": "<string>",
"inputTokenCount": 123,
"outputTokenCount": 123,
"totalTokenCount": 123
}
]
}
使用以下格式进行身份验证:Bearer <your api key>
应用id
会话id, 未传则默认创建新会话
三方请求id(调用插件时传入, 用于链路排查问题)
默认true,false时为同步调用
对话类应用请求必传:user(用户输入), assistant(模型返回)
是否实时推送过程日志,默认false
请求成功
请求id
会话id
应用id
增量返回的信息
Hide child attributes
结果下标
stop: 正常结束 error: 执行失败
Hide child attributes
Hide child attributes
节点id
节点名称
事件类型 node_processing/tool_processing/tool_finish/node_finish
输入输出内容
毫秒
Hide child attributes