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
}
}
}Messages API
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
POST
/
v1
/
messages
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
}
}
}BaseURL: The default BaseURL is
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.The GLM series has thinking on by default — the response
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
application/json
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.3-flashx | Multimodal model with image input; 1M context |
glm-5.2 | Previous-generation flagship, complex reasoning and very long context; 1M context |
Available options:
glm-5.3, glm-5.3-flash, glm-5.3-flashx, glm-5.2 Example:
"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.
Required range:
1 <= x <= 131072Example:
1024
Response
Message object
Anthropic-style message response