How to Use GLM-5.3-Flash in Claude Code and Cline

Wire GLM-5.3-Flash into Claude Code and Cline: base URLs, env vars, the Cline context fix, and why the 3x Coding Plan quota is the real draw.

INEZA Felin-Michel

INEZA Felin-Michel

27 August 2026

How to Use GLM-5.3-Flash in Claude Code and Cline

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

If you already subscribe to the GLM Coding Plan, there is a specific reason to care about GLM-5.3-Flash: it reportedly carries three times the usable quota of GLM-5.3 on the same plan. That is the whole argument. Three times as many requests, in exchange for a model that scores 57 on the Artificial Analysis Intelligence Index instead of 60.

For routine coding work, that trade is easy. This guide covers wiring Flash into Claude Code and Cline, when to keep GLM-5.3 in the loop, and the configuration details that tend to cause trouble.

button

What you need first

Verify the quota multiplier and plan tiers on z.ai before planning around them. Plan terms change more often than model specs do, and the 3x figure comes from Z.ai’s own documentation.

Claude Code

Z.ai exposes an Anthropic-compatible endpoint, which means Claude Code can talk to GLM models by changing two environment variables.

The fast way

Z.ai ships a helper that writes the configuration for you:

npx @z_ai/coding-helper

It prompts for your key and sets up the config. If it works, skip to the model selection section below.

The manual way

Set the base URL and token in your shell profile:

export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-z-ai-key"

Then start Claude Code as normal. It will route requests to Z.ai instead of Anthropic.

Two things go wrong here more than anything else:

ANTHROPIC_API_KEY is not the same variable as ANTHROPIC_AUTH_TOKEN. If you have an old Anthropic key exported, unset it. Having both set produces authentication errors that read like a bad key rather than a conflict.

The environment has to reach the process. If you set these in .zshrc and launch Claude Code from an editor or a launcher that does not source your shell profile, it will not see them. Test with echo $ANTHROPIC_BASE_URL in the same context you launch from.

Selecting the model

Once connected, select glm-5.3-flash as the model. If your setup uses a settings file, the model id goes there:

{
  "model": "glm-5.3-flash"
}

Long-context work benefits from raising the timeout, since a 1M-token window means requests can legitimately take a while:

export API_TIMEOUT_MS=3000000

That value carries over from the GLM-5.2 setup and is worth checking against your own experience. Our GLM-5.2 harness guide covers the previous generation if you are migrating an existing config.

Cline

Cline connects through its OpenAI-compatible provider rather than an Anthropic-shaped one.

  1. Open Cline settings and choose OpenAI Compatible as the API provider.
  2. Set the base URL to https://api.z.ai/api/coding/paas/v4.
  3. Paste your Z.ai API key.
  4. Choose Custom Model and enter glm-5.3-flash.

Note the base URL. The coding-plan endpoint (/api/coding/paas/v4) is different from the standard API endpoint (/api/paas/v4) used for direct API calls in our API guide. Both URLs circulate in documentation and community posts, and using the standard one with a coding-plan key is a common source of confusing authorization failures. Verify both against current Z.ai docs, since these paths have moved before.

The context window setting

Cline does not always infer the context window correctly for custom models. If you are working with large codebases and seeing premature truncation, set the context window manually to 1,000,000.

This bit users on GLM-5.2 as well. The symptom is Cline dropping file context earlier than it should while the model itself is perfectly capable of holding it.

Why Flash for agentic coding

The benchmark case, using Z.ai’s launch numbers:

Benchmark GLM-5.3-Flash GLM-5.2
Terminal-Bench 2.1 84.3 not directly comparable
DeepSWE 63.4 46.2
AutomationBench 48.8 26.2

The Terminal-Bench figure was evaluated against Claude Code 2.1.207, which makes it directly relevant to the harness most readers here are using. Treat these as vendor claims until independent reproductions land.

The independent measurement, from Artificial Analysis, is an Intelligence Index of 57 against GLM-5.3’s 60.

There is one thing genuinely new for a coding harness: native image input. Flash accepts screenshots as content blocks in the same request as your code. For front-end work, that means pasting a screenshot of a broken layout into the conversation and having the model reason about the rendering rather than about your description of the rendering. Z.ai’s own positioning talks about observing interfaces and rendering results. Our vision guide covers what that pathway can do.

The speed tradeoff, stated plainly

GLM-5.3-Flash generates at roughly 49 tokens per second. GLM-5.3 manages about 86. In a coding harness that streams long file rewrites, you will feel that.

Time to first token is effectively identical, at 1.52 versus 1.57 seconds, so the model starts responding just as quickly. The difference shows up on long outputs.

This is the honest counterweight to the quota argument. Three times the quota, roughly half the generation speed. For short edits, tool calls, and iterative work, quota wins. For “rewrite this 800-line file,” the wait is real.

A practical routing strategy

Rather than picking one, use both:

Switching is a model id change in your harness settings, so escalation costs a few seconds. If you are on the Coding Plan, this keeps most of your volume on the 3x-quota model and reserves the expensive quota for work that needs it.

Z.ai also notes that off-peak calls consume only half the standard points, so scheduling batch or background agent work outside peak hours stretches the plan further.

Troubleshooting

The failures on this setup cluster into a handful of shapes.

401 or 403 on every request. Almost always the wrong base URL for the key you hold, or a stale ANTHROPIC_API_KEY shadowing ANTHROPIC_AUTH_TOKEN. Confirm with the direct curl call at the end of this post before touching harness settings.

Model not found. Check the id string exactly. It is glm-5.3-flash, with dots in the version and a hyphen before flash. On OpenRouter it is namespaced as z-ai/glm-5.3-flash, which is not interchangeable with the Z.ai native id.

Context truncated early. Set the context window manually in Cline. It does not reliably infer 1,000,000 for custom models.

Timeouts on large requests. Raise API_TIMEOUT_MS. A genuinely long-context request can exceed default client timeouts without anything being wrong.

Quota exhausted sooner than expected. reasoning_effort defaults to max, and reasoning tokens count. If your harness lets you set it, dropping to low for routine work stretches the plan considerably.

Tool calls failing or malformed. Confirm the harness and the endpoint agree on tool-call format. This is the most version-sensitive part of the integration and the most likely thing to break after an update on either side.

Other harnesses

The same two connection shapes cover most tools. Anything Anthropic-compatible (Claude Code, some agent frameworks) uses https://api.z.ai/api/anthropic with ANTHROPIC_AUTH_TOKEN. Anything OpenAI-compatible (Cline, Roo, Kilo, OpenCode, Codex, Cursor’s custom model option) uses https://api.z.ai/api/coding/paas/v4 with the key in the standard API key field and glm-5.3-flash as a custom model id.

Our earlier guides cover the pattern on previous models: GLM-5.1 with Claude Code and Claude Code and Cursor with GLM-4.7.

Verifying the connection

Before trusting a harness config, confirm the endpoint works on its own. A direct call rules out the harness as the source of any problem:

curl https://api.z.ai/api/coding/paas/v4/chat/completions \
  -H "Authorization: Bearer $ZAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-flash",
    "messages": [{"role": "user", "content": "reply with OK"}]
  }'

If that returns a completion and your harness still fails, the problem is configuration, not credentials.

For anything more than a one-off check, Apidog is a better home for these calls than shell history. Save the coding endpoint and the standard endpoint side by side with the key stored as an environment variable, and when a harness starts throwing authorization errors you can tell in one click whether the endpoint or the tool is at fault. That distinction is most of the debugging time on these setups.

FAQ

Do I need a Coding Plan, or will API credits work? Both work. The Coding Plan is usually cheaper for a developer coding daily; metered API access suits applications. Our pricing post compares them.

Is Flash really 3x the quota of GLM-5.3? That is Z.ai’s stated figure. Verify it on z.ai/subscribe before planning around it.

Why does Cline truncate my context? Set the context window manually to 1,000,000. Cline does not always infer it for custom models.

Which base URL do I use? https://api.z.ai/api/anthropic for Claude Code, https://api.z.ai/api/coding/paas/v4 for OpenAI-compatible tools on the Coding Plan, and https://api.z.ai/api/paas/v4 for direct API calls.

Can I paste screenshots into Claude Code with Flash? The model supports native image input. Whether your harness version exposes it is a separate question, so test it before depending on it.

Explore more

How to Use the GLM-5.3-Flash API (With Image Input)

How to Use the GLM-5.3-Flash API (With Image Input)

Call the GLM-5.3-Flash API with the OpenAI SDK: auth, the image_url payload for native image input, reasoning_effort, streaming, and tool calling.

27 August 2026

How to Run GLM-5.3-Flash Locally

How to Run GLM-5.3-Flash Locally

Self-host GLM-5.3-Flash: 8x H200 with vLLM or SGLang, quantized GGUF builds for smaller rigs, memory math, and whether self-hosting beats the API.

27 August 2026

How to Test the GLM-5.3-Flash API in Apidog

How to Test the GLM-5.3-Flash API in Apidog

Build a reusable test collection for the GLM-5.3-Flash API: text calls, base64 image payloads, tool calling, assertions, and a GLM-5.3 comparison run.

27 August 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

How to Use GLM-5.3-Flash in Claude Code and Cline