stream: true 时返回 SSE 流:先收到 delta.reasoning_content(思维链)分片,再收到 delta.content(正文)分片,以 data: [DONE] 结束。max_tokens,值太小会导致 content 为空且 finish_reason=length,建议 ≥ 1024。Authorization: Bearer ********************{
"model": "glm-5.3-flash",
"messages": [
{
"role": "user",
"content": "你好,用一句话介绍你自己"
}
],
"max_tokens": 1024
}curl --location '/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "glm-5.3-flash",
"messages": [
{
"role": "user",
"content": "你好,用一句话介绍你自己"
}
],
"max_tokens": 1024
}'stream: true 时返回 text/event-stream(SSE)。{
"id": "chatcmpl-cb31b9ad-d919-4e21-bbef-27fdbd82c967",
"object": "chat.completion",
"created": 1795078235,
"model": "glm-5.3-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我是GLM大语言模型,能够理解和生成人类语言来协助你解决问题。",
"reasoning_content": "用户让我用一句话介绍自己。首先……"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 447,
"total_tokens": 465,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 330
}
}
}