glm-5
Capability: 128K context · tool use · streaming · structured output · CJK-native
Pricing: per-token, mid tier (live rate)
GLM-5 is Zhipu’s prior flagship — the model that brought tool use and
structured output to parity with Western mid-tiers in the Chinese
open-weight ecosystem. Still a fine production model.
GLM-5-1 is the recommended starting
point for new work.
Request
Body parameters
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | yes | — | glm-5 |
messages | array | yes | — | CJK accepted natively. |
max_tokens | integer | no | model max | Max: 8192. |
tools | array | no | — | Function calling supported. |
response_format | object | no | — | JSON mode. |
stream | boolean | no | false | SSE streaming. |
Response
Code examples
Streaming + caching
"stream": true for SSE. Automatic prompt caching.
Errors
| Code | Trigger | Billed? |
|---|---|---|
| 400 / 401 / 402 / 422 / 429 | Standard | No |
| 5xx | Upstream | No (auto-retry) |
When to use
- Existing Chinese-market projects validated against this version.
- For new work, prefer GLM-5-1.
- For larger context, see Kimi K2.6.
Limits
| Limit | Value |
|---|---|
| Context window | 128K tokens |
| Max output | 8192 tokens |
| Supports tool use | Yes |
| Supports vision | No |
| Supports streaming | Yes |
| Supports prompt caching | Automatic |