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
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:
Body
application/json
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
Token usage statistics returned when the call ends
Content safety-related information