Use GLM (Z.ai) as a coding agent
Export ZAI_API_KEY and run oharness -m zai/glm-5.3. A GLM Coding Plan uses a different endpoint and key: set ZAI_CODING_API_KEY and use the zai-coding provider instead.
Pay-as-you-go
npm install -g oharnessexport ZAI_API_KEY="..."oharness -m zai/glm-5.3GLM Coding Plan
export ZAI_CODING_API_KEY="..."oharness -m zai-coding/glm-5.3The two are separate providers because the keys are not interchangeable: a plan key is refused on the pay-as-you-go host, and a pay-as-you-go key is not billed against a plan.
Which model
| Model id | Context | Input / cached / output ($/M) |
|---|---|---|
glm-5.3 | 1M | 1.40 / 0.26 / 4.40 |
glm-5.3-flash | 1M | 0.15 / 0.03 / 0.50 |
glm-4.7-flash | 200K | Free at list price |
List prices from the models.dev snapshot OHarness ships (2026-09-19); check Z.ai's pricing before relying on them.
Mainland accounts (bigmodel.cn)
The zai provider is Zhipu's international platform. A mainland Zhipu key works against the mainland host instead — override the base URL in ~/.oharness/config.json:
{ "providers": { "zai": { "baseUrl": "https://open.bigmodel.cn/api/paas/v4" } } }Common questions
Can I use GLM with a Claude Code-style agent?
Yes. OHarness has Z.ai as a built-in provider: set ZAI_API_KEY and run oharness -m zai/glm-5.3. A GLM Coding Plan uses the zai-coding provider with ZAI_CODING_API_KEY.
Why does my GLM Coding Plan key not work?
Plan keys only work on the plan's endpoint. In OHarness that is the zai-coding provider, which reads ZAI_CODING_API_KEY; the zai provider is pay-as-you-go.
Z.ai (GLM) reference
| Provider id | zai |
| Base URL | https://api.z.ai/api/paas/v4 |
| Protocol | OpenAI-compatible chat completions |
| API key | ZAI_API_KEY or Z_AI_API_KEY |
| Model discovery | Yes — the model list is asked of the endpoint rather than shipped. |
Connecting it
The endpoint above is built in, so there is nothing to configure. Put the key in the environment and the provider appears in the model picker:
export ZAI_API_KEY="..."Keys are issued by Z.ai (GLM) — where to get one.
Models on Z.ai (GLM)
The newest models Z.ai (GLM) serves that can call tools, from the models.dev snapshot OHarness ships. The harness also asks the endpoint for its live list, so a model released after this snapshot still appears in the picker.
| Model id | Context / output | $/M in / cached / out | Reasoning |
|---|---|---|---|
glm-5.3-flashx | 1M / 131K | 0.37 / 0.075 / 1.25 | Yes |
glm-5.3-flash | 1M / 131K | 0.15 / 0.03 / 0.5 | Yes |
glm-5.3 | 1M / 131K | 1.4 / 0.26 / 4.4 | Yes |
glm-5.2 | 1M / 131K | 1.4 / 0.26 / 4.4 | Yes |
glm-5.1 | 200K / 131K | 1.4 / 0.26 / 4.4 | Yes |
glm-5v-turbo | 200K / 131K | 1.2 / 0.24 / 4 | Yes |
glm-5-turbo | 200K / 131K | 1.2 / 0.24 / 4 | Yes |
glm-5 | 205K / 131K | 1 / 0.2 / 3.2 | Yes |
glm-4.7-flash | 200K / 131K | 0 / 0 / 0 | Yes |
glm-4.7-flashx | 200K / 131K | 0.07 / 0.01 / 0.4 | Yes |
List prices in USD per million tokens, read from models.dev on 2026-09-19. Z.ai (GLM) changes its prices and models; its own pricing page is the authority. Start a session on the newest:
oharness -m zai/glm-5.3-flashxWorth knowing
Zhipu's international arm, a separate host and a separate key from zhipu. A GLM Coding Plan is served from its own endpoint; see zai-coding.
Pointing it somewhere else
A regional host, a gateway, or a server of your own. Overrides in ~/.oharness/config.json are field level, so changing the endpoint does not mean restating the rest of the provider — this is the whole block, shown holding the default so the shape is clear:
{
"providers": {
"zai": {
"baseUrl": "https://api.z.ai/api/paas/v4"
}
}
}What you get either way
The same agent loop, the same tools, the same MCP servers and the same permission rules, whichever provider is underneath — and switching between them mid-session converts nothing, because history is never stored in a vendor’s shape. What an agent harness is covers why that is the hard part, and the providers reference covers the catalogue itself.