curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself in one sentence"
}
]
}
'{
"id": "msg_0842a705-9d0b-4eaa-b12d-09a4106326c5",
"type": "message",
"role": "assistant",
"model": "glm-5.3",
"content": [
{
"type": "thinking",
"thinking": "The user asked to greet them with one word, so answering \"Hi\" will do.",
"signature": ""
},
{
"type": "text",
"text": "Hi."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 18,
"output_tokens": 101,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}GLM All-Model API - Messages Quickstart
- Call GLM series models through the Anthropic Messages protocol, choosing the specific model with the
modelparameter model,max_tokensandmessagesare the only parameters you need (max_tokensis mandatory in the Anthropic protocol)- 1M token context window across the series, with up to 131,072 output tokens
- Thinking is on by default across the series, so the response
contentcarries atype="thinking"block, and that part counts towards output tokens - For streaming, tool calls, image input and other capabilities, see the Reference page
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself in one sentence"
}
]
}
'{
"id": "msg_0842a705-9d0b-4eaa-b12d-09a4106326c5",
"type": "message",
"role": "assistant",
"model": "glm-5.3",
"content": [
{
"type": "thinking",
"thinking": "The user asked to greet them with one word, so answering \"Hi\" will do.",
"signature": ""
},
{
"type": "text",
"text": "Hi."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 18,
"output_tokens": 101,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}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.content array carries a type="thinking" block, and that part counts towards output tokens. So max_tokens should not be set too low; 1024 or higher is recommended, otherwise the response may be truncated before the thinking finishes and you get no answer text.Authorizations
##All interfaces require authentication using a Bearer Token##
Get an API Key:
Visit the API Key management page to obtain your API Key
Add it to the request header when using:
Authorization: Bearer YOUR_API_KEY
Note: EvoLink uses Bearer Token authentication uniformly for /v1/messages.
Body
Model to call:
| Model ID | Positioning |
|---|---|
glm-5.3 | Flagship model, with across-the-board gains on complex software engineering and agent tasks; 1M context |
glm-5.3-flash | Lightweight multimodal model, extremely low cost, native image input; 1M context |
glm-5.2 | Previous-generation flagship, complex reasoning and very long context; 1M context |
glm-5.3, glm-5.3-flash, glm-5.2 "glm-5.3"
Maximum number of tokens to generate for this request; required by the Anthropic protocol.
Note: the GLM series has thinking on by default, and the thinking content also consumes output tokens, so this value should not be too small — 1024 or higher is recommended.
1 <= x <= 1310721024
The list of conversation messages, in chronological order. At least one message is required.
1Show child attributes
Show child attributes
Response
Message object
Anthropic-style message response
The message's unique ID (format: msg_<uuid>)
Response object type
message assistant Model actually used
"glm-5.3"
The list of response content blocks
Possible block types:
thinking: the reasoning process (when thinking is enabled, which is the default)text: the final answer texttool_use: a tool call initiated by the model
Show child attributes
Show child attributes
Stop reason
end_turn: natural completion (also returned when stop_sequences is hit)max_tokens: reached the max_tokens limittool_use: the model triggered a tool call
end_turn, max_tokens, tool_use Token usage statistics (Anthropic specification)
Show child attributes
Show child attributes