GLM-5.3
Call GLM-5.3 through the OpenAI-compatible Chat Completions API.
| Item | Value |
|---|---|
| Base URL | https://api.hop-base.com/v1 |
| Model | glm-5.3 |
| Chat | POST /v1/chat/completions only — /v1/responses and /v1/messages are not supported and return 400 |
Use a key that includes the GLM Official Direct group; keys without it get a 404.
Group selection and billing
GLM-5.3 is Zhipu's latest flagship: 1M context window with thinking-length control, served via official direct access.
glm-5.3is sold through the GLM Official Direct group, with a 1M context window. When creating or editing a key under API Keys in the console, add this group to the key. Your effective rate is shown in the signed-in model catalog.- Keys that include neither group get a clear 404 when calling
glm-5.3— add one of these groups to the key in the console, or create a new key with it. - GLM-5.2 has been discontinued; projects that called
glm-5.2only need to switch the model name toglm-5.3.
Request parameters
For POST /v1/chat/completions. The gateway only rejects empty messages; every other limit comes from the model service, with error text quoted from production records.
| Parameter | Required | Type & limits | Default | Description |
|---|---|---|---|---|
model | Required | glm-5.3 | — | Exact match |
messages | Required | Non-empty array, text only | — | Missing or empty returns a gateway 400; images return 400. Context is 1M |
max_tokens | Optional | Integer 1–131,072 | Service default | Outside the range returns 400 max_tokens参数非法:限制数值范围[1,131072]; shared by thinking and answer |
reasoning_effort | Optional | low / high / max | Model default | Always thinks: none or any other thinking-off value returns 400 |
temperature, top_p | Optional | Passed through; no gateway range | Service default | Sampling controls, forwarded as-is |
tools, tool_choice | Optional | As in OpenAI | auto | A returned tool result must match a call ID from the previous turn, or you get 400 No tool call found for function call output |
stream | Optional | Boolean | false | true returns server-sent events |
stream_options.include_usage | Optional | Boolean | false | Must be true to receive the usage chunk when streaming |
The wording of the thinking-off 400 differs between groups, so handle it by status code and your reasoning_effort value, not the message text.
Client fields
| Field | Value |
|---|---|
| API address / Base URL | https://api.hop-base.com/v1 |
| API Key | sk-your-key |
| Model | glm-5.3 |
| API format (CC Switch and other routing-capable clients only) | OpenAI Chat Completions (routing required) |
The "API format" field above exists only in CC Switch and similar clients that can route between protocols — it is not a parameter you send in the request body. In Claude Code, CC Switch, and other clients that support routing, GLM-5.3 does not use the Anthropic protocol. In advanced settings, select OpenAI Chat Completions (routing required). A plain OpenAI SDK or curl call never touches this setting; skip straight to the sections below.
Use GLM-5.3 in Claude Code with CC Switch
Use CC Switch 3.17.0 or later. GLM-5.3 uses OpenAI Chat Completions, so CC Switch must translate requests through its local router into the Anthropic Messages protocol used by Claude Code.
Add a HopBase GLM provider
Open CC Switch, select the Claude Code tab, select + in the upper-right corner, then choose Custom configuration. Enter:
- Provider name:
HopBase GLM - API Key: your
sk-key - Request URL:
https://api.hop-base.com/v1
Set the API format and model mapping
Expand Advanced options, apply these settings, then save:
- API format: OpenAI Chat Completions (routing required)
- Authentication field: keep the default ANTHROPIC_AUTH_TOKEN
- Default fallback model:
glm-5.3
To force the Sonnet, Opus, and Haiku roles to use GLM-5.3, also map all three roles to glm-5.3. After saving, the provider card shows Routing required.
Enable local routing
Open Settings → Routing → Local routing. Enable the main routing switch, then enable Claude Code under application routing. Confirm the first-run message and leave CC Switch running in the background.
Enable and verify the provider
Return to the Claude Code provider list and select Enable on the HopBase GLM card. After enabling routing takeover for the first time, close and reopen the terminal, run claude, and send a short prompt.
Return to Settings → Routing. The setup works when Current Provider shows HopBase GLM and the request count increases. Once routing is active, later provider switches are hot-swapped without another terminal restart.
Codex CLI
glm-5.3 and glm-5.3-flash in the GLM Official Direct group only offer OpenAI Chat Completions: /v1/responses returns 400 endpoint_not_supported. Codex CLI has spoken only Responses since 0.122 (wire_api = "chat" was removed), so Codex CLI cannot connect to GLM-5.3. In Codex CLI, use GPT, DeepSeek, Qwen, or the US Region glm-5.3-us, which supports all three protocols — see US Region.
OpenAI SDK / Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.hop-base.com/v1",
api_key="sk-your-key",
)
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{
"role": "user",
"content": "Explain where GLM-5.3 works best",
}],
)
print(resp.choices[0].message.content)curl
curl https://api.hop-base.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [{"role": "user", "content": "Hello, introduce yourself"}]
}'Next steps
- GLM-5.3 Flash — multimodal, lower unit price
- CC Switch — installing and troubleshooting the local router
- Error codes and retries
- Concurrency, timeouts, and billing