curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself in one sentence"
}
]
}
'{
"id": "chatcmpl-a6613b56-c61c-94ba-9a9f-43d4cdc7d77a",
"object": "chat.completion",
"request_id": "req-7f3a2c1e8b9d4f0a",
"created": 1777021417,
"model": "glm-5.3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm GLM-5.3, and I can help you with a variety of tasks such as conversation, reasoning, writing, and code.",
"reasoning_content": "Let me first analyze this problem...",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 346,
"total_tokens": 370,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 321
}
},
"content_filter": [
{
"role": "assistant",
"level": 1
}
]
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "glm-5.3"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}Chat Completions API
GLM All-Model API - Chat Completions Quickstart
- Call GLM series models through the OpenAI Chat Completions protocol, choosing the specific model with the
modelparameter modelandmessagesare the only parameters you need- 1M token context window across the series, with up to 131,072 output tokens
- Deep thinking is on by default across the series, and the reasoning is returned in
reasoning_content - For streaming, tool calls, thinking-depth control, image input and other capabilities, see the Reference page
POST
/
v1
/
chat
/
completions
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "glm-5.3",
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself in one sentence"
}
]
}
'{
"id": "chatcmpl-a6613b56-c61c-94ba-9a9f-43d4cdc7d77a",
"object": "chat.completion",
"request_id": "req-7f3a2c1e8b9d4f0a",
"created": 1777021417,
"model": "glm-5.3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm GLM-5.3, and I can help you with a variety of tasks such as conversation, reasoning, writing, and code.",
"reasoning_content": "Let me first analyze this problem...",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 346,
"total_tokens": 370,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 321
}
},
"content_filter": [
{
"role": "assistant",
"level": 1
}
]
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "glm-5.3"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}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.Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
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.2 | Previous-generation flagship, complex reasoning and very long context; 1M context |
Available options:
glm-5.3, glm-5.3-flash, glm-5.2 Example:
"glm-5.3"
The list of conversation messages, in chronological order. At least one message is required.
Minimum array length:
1Show child attributes
Show child attributes
Response
Chat completion generated successfully
Task ID
Example:
"chatcmpl-a6613b56-c61c-94ba-9a9f-43d4cdc7d77a"
Response type
Available options:
chat.completion Example:
"chat.completion"
Request ID (returned when request_id is provided in the request)
Example:
"req-7f3a2c1e8b9d4f0a"
Request creation time, Unix timestamp (seconds)
Example:
1777021417
Model name
Example:
"glm-5.3"
The list of model responses
Show child attributes
Show child attributes
Token usage statistics returned when the call ends
Show child attributes
Show child attributes
Content safety-related information
Show child attributes
Show child attributes