POST
/v1/chat/completions
API reference
OpenAI-compatible endpoint for chat requests. Works with every text model: Claude, GPT, and GLM.
Request
JSON
bash
{
"model": "claude-sonnet-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Tell me about quantum physics"}
],
"max_tokens": 1024,
"stream": false
}Parameters
Parameter
Type
Required
Description
model
string
Yes
Model ID (see the models list)
messages
array
Yes
Array of messages
max_tokens
integer
No
Max. number of tokens in the response. For GLM Zukko raises it to at least 256 (4096 with reasoning)
temperature
float
No
Sampling temperature (0-2). 0 turns on the Zukko cache (the X-Zukko-Cache: true header is more reliable). Newer Claude models may reject non-default values — omit it for them
stream
boolean
No
Stream the response
top_p
float
No
Nucleus sampling
reasoning_effort
string
No
For GLM: high enables reasoning. For other models it is passed to the provider as is
Response
JSON
bash
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "claude-sonnet-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum physics is a branch of..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 150,
"total_tokens": 175
}
}Streaming mode (stream: true)
With stream: true the response is delivered as Server-Sent Events (SSE):
text
data: {"id":"chatcmpl-...","choices":[{"delta":{"content":"Quantum"},"index":0}]}
data: {"id":"chatcmpl-...","choices":[{"delta":{"content":" physics"},"index":0}]}
data: {"id":"chatcmpl-...","choices":[],"usage":{"prompt_tokens":25,"completion_tokens":150,"total_tokens":175}}
data: [DONE]For Claude and GPT Zukko enables stream_options.include_usage itself, so the last chunk before [DONE] carries usage and an empty choices array. Check the length of choices before reading choices[0]. See Streaming.