GLM-5.3 API
https://api.hiapi.ai /v1/chat/completions This model uses an OpenAI-compatible Chat Completions endpoint. The same HiAPI API key can call enabled models in your account group; image, video, and audio models use /v1/tasks and a different request shape.
Model overview
| Model name | glm-5.3 |
|---|---|
| Provider | Zhipu AI |
| Type | Text generation · Chat Completions |
| Input / output | Text / text |
| Pricing | Live HiAPI token rates |
GLM-5.3 is Zhipu AI’s flagship model announced for ZCode. HiAPI exposes the model through an OpenAI-compatible Chat Completions endpoint for text input and text output.
Production guidance
- Send POST /v1/chat/completions with model=glm-5.3 and messages. The same HiAPI API key works across enabled models; media models use /v1/tasks with a different request shape.
- This page documents the current HiAPI request contract. Responses may include reasoning_content as part of the assistant message; no selectable reasoning switch or effort mapping is exposed.
Best suited for
Use an OpenAI-compatible request shape for server-side text generation.
messagesSet stream=true when the client needs incremental output.
streamRequest parameters
model string required Use this exact public model ID.
messages array required Conversation messages in order.
role enum required Message role.
content string required Message text.
stream boolean optional Set true for Server-Sent Events.
max_tokens integer optional Optional output budget; the request must fit the model context available in this integration.
response_format object optional Use type=json_object for JSON Mode.
tools array optional OpenAI-compatible function definitions.
tool_choice string | object optional Use required to force a function call, or auto for optional calls.
API examples
Request examples
Set stream=true and process SSE chunks until [DONE].
{
"model": "glm-5.3",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Explain HTTP caching in three short paragraphs."
}
],
"stream": true
}Set response_format.type=json_object and parse the returned message content as JSON.
{
"model": "glm-5.3",
"messages": [
{
"role": "user",
"content": "Return JSON with a single string field named answer. The value should be yes."
}
],
"stream": false,
"response_format": {
"type": "json_object"
}
}Declare a function, execute the returned tool call, then continue with the assistant tool-call message and matching tool result.
{
"model": "glm-5.3",
"messages": [
{
"role": "user",
"content": "What is the weather in Shanghai? Use the function."
}
],
"stream": false,
"tool_choice": "required",
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
]
}Response schema
Non-streaming responses follow the Chat Completions schema. Thinking mode also returns reasoning_content; usage is the billing detail source.
{
"id": "chatcmpl_example",
"object": "chat.completion",
"model": "glm-5.3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "An HTTP cache stores reusable responses.",
"reasoning_content": "First identify the scope, then give a concise answer."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 18,
"total_tokens": 42
}
} - Read choices[0].message.content for the final text; reasoning_content may also be present.
- For streaming, accumulate choices[0].delta.content and handle [DONE].
- Read prompt, completion, and total token counts from usage.
FAQ
Which endpoint and model ID should I use?
Use POST /v1/chat/completions with model=glm-5.3.
Can I reuse an OpenAI SDK client?
Yes. Set base_url to https://api.hiapi.ai/v1, use a HiAPI API key, and call chat.completions.create with messages.
Does it support JSON Mode and function tools?
Yes. JSON Mode uses response_format.type=json_object. Function calling uses OpenAI-compatible tools; execute the returned tool call and continue with the original assistant tool_calls plus a matching role=tool message.
Can the same API key call media models?
Yes, when enabled for the account. Media generation uses POST /v1/tasks and a different request shape.
How are tokens billed?
Check the live HiAPI pricing page and the usage object returned by each request. Do not copy upstream or third-party aggregator prices into your integration. View live pricing.