curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3-flash",
"input": "Introduce yourself in one sentence.",
"max_output_tokens": 1024,
"reasoning": {
"effort": "low"
}
}
'{
"id": "response_demo",
"object": "response",
"created_at": 1789971757,
"model": "glm-5.3-flash",
"status": "completed",
"output": [
{
"type": "message",
"id": "message_demo",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Hello, I am GLM. I can help with conversation, writing and coding.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 17,
"output_tokens": 24,
"total_tokens": 41,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens_details": {
"reasoning_tokens": 0
}
},
"error": null
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}GLM All-Model API - Responses Quickstart
Call GLM with model and input. Supported models: glm-5.3, glm-5.3-flash, glm-5.3-flashx and glm-5.2. Set max_output_tokens to 1024 or higher to leave room for reasoning and the answer.
See the full reference for more examples and model differences.
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3-flash",
"input": "Introduce yourself in one sentence.",
"max_output_tokens": 1024,
"reasoning": {
"effort": "low"
}
}
'{
"id": "response_demo",
"object": "response",
"created_at": 1789971757,
"model": "glm-5.3-flash",
"status": "completed",
"output": [
{
"type": "message",
"id": "message_demo",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Hello, I am GLM. I can help with conversation, writing and coding.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 17,
"output_tokens": 24,
"total_tokens": 41,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens_details": {
"reasoning_tokens": 0
}
},
"error": null
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.reasoning.effort, rather than top-level reasoning_effort or thinking. Reasoning usage is included in output_tokens. Simple tasks may return reasoning_tokens=0; this does not imply that thinking can be disabled.Reasoning effort; low is recommended.Compatibility rules for glm-5.3 / glm-5.3-flash / glm-5.3-flashx| Supplied value | Effective thinking level |
|---|---|
low / high / max | Unchanged |
xhigh | max |
medium | high |
minimal / none | low; thinking remains enabled |
minimal and none do not disable thinking on the 5.3 series. Thinking tokens are billed as output. Unrecognized values are unchanged and have no compatibility mapping; use the listed values. These mappings do not apply to glm-5.2.On this endpoint, glm-5.2 may still produce reasoning tokens with none. This value does not guarantee that thinking is disabled.Read the answer
Ordered output items. Extract text from content entries withtype=output_text inside type=message items. Reasoning may precede the answer, and function_call turns may contain no answer text. Do not always read output[0].
Once the response JSON is parsed into response, extract the answer as follows:
text = "".join(
part["text"]
for item in response.get("output", [])
if item.get("type") == "message"
for part in item.get("content", [])
if part.get("type") == "output_text"
)
print(text)
max_output_tokens, not max_tokens.Authorizations
Send Bearer YOUR_API_KEY in the Authorization header.
Body
Choose a GLM model. All four support text on this endpoint. Optional capabilities vary by model.
| Model ID | Input | Reasoning notes |
|---|---|---|
glm-5.3 | Text | Effective levels: low / high / max; compatible values are listed under reasoning. Thinking cannot be disabled. |
glm-5.3-flash | Text, images | Same as glm-5.3; use input_image for images. |
glm-5.3-flashx | Text, images | Same as glm-5.3; use input_image for images. |
glm-5.2 | Text | none may still produce reasoning tokens and does not guarantee that thinking is disabled. |
glm-5.3, glm-5.3-flash, glm-5.3-flashx, glm-5.2 "glm-5.3-flash"
Required. A text string or an array of Responses input items. Arrays accept messages, returned model output items and function_call_output. For multi-turn conversations, include the full history in each request. Put the system prompt first as a role=system message. Images use input_image, supported only by glm-5.3-flash and glm-5.3-flashx. Do not use the Chat Completions messages / image_url block format.
"Introduce yourself in one sentence."
Maximum output tokens for this generation, including reasoning. Start at 1024 and adjust for the task. A small budget may be exhausted during reasoning, leaving only reasoning items and no answer. Check status and incomplete_details. The parameter name is max_output_tokens, not max_tokens.
x >= 11024
Enable SSE streaming. Read answer text from delta in response.output_text.delta. The successful terminal event is response.completed. Also end the turn and handle response.incomplete, response.failed or error. Do not wait only for [DONE] or connection closure.
Responses uses nested reasoning.effort, rather than top-level reasoning_effort or thinking. Reasoning usage is included in output_tokens. Simple tasks may return reasoning_tokens=0; this does not imply that thinking can be disabled.
Show child attributes
Show child attributes
Response
Generation completed or returned an incomplete result; check status. Streaming returns text/event-stream.
ID of this response. Pass it unchanged as previous_response_id.
"response_demo"
"response"Creation time in Unix seconds.
"glm-5.3-flash"
completed means generation for this turn has ended, possibly with tool calls only. incomplete means the output is incomplete. Check both output and error.
completed, incomplete, failed, in_progress, queued Ordered output items. Extract text from content entries with type=output_text inside type=message items. Reasoning may precede the answer, and function_call turns may contain no answer text. Do not always read output[0].
Show child attributes
Show child attributes
Optional aggregated answer text; it may be absent. General-purpose clients should traverse output.
Show child attributes
Show child attributes
Response error, normally null on success.
Show child attributes
Show child attributes
Show child attributes
Show child attributes