Skip to content

LearnTutorials

Run Claude Code on GLM-5.3 with the GLM Coding Plan

Connect Claude Code to Z.ai's GLM-5.3 with a GLM Coding Plan key in 20 minutes, then use the same plan in Cline, for one flat monthly price.

By Recaply EditorsIntermediate20 min6 stepsUpdated

A hand turns a round dial set on an open laptop while the other hand rests on the keys

What you need

The plan works only in Z.ai's list of supported tools, such as Claude Code, Cline, OpenCode and Kilo Code. Subscriptions can't be refunded.

  1. Step 1: Subscribe and create a plan key

    4 min

    Only a key made under your Coding Plan uses plan credits. A standard API key bills your account balance instead.

    1. Go to z.ai/subscribe, sign in and pick a plan.
    2. Open the API Keys page and choose the Personal Coding Plan tab.
    3. Create a key and copy it.

    You should see your new key listed under Personal Coding Plan.

    Your account balance goes down even though you have a plan?

    The tool is using a Standard API Key. Create a key under Personal Coding Plan and use that one instead.

    Keep the key out of shared files, screenshots and git repos. Anyone who has it can spend your credits.

  2. Step 2: Install or update Claude Code

    3 min

    Claude Code needs a recent version to accept GLM's model names with the 1M-token tag.

    1. Mac or Linux: run the command below. Windows: run irm https://claude.ai/install.ps1 | iex in PowerShell.
    2. Already installed? Run claude update instead.
    3. Open a new terminal window and run claude --version.
    Mac or Linux: run this
    curl -fsSL https://claude.ai/install.sh | bash

    You should see a version number followed by (Claude Code).

    The terminal says it can't find claude?

    Open a new terminal window so it picks up the new install folder, then run the check again.

  3. Step 3: Add the GLM settings

    5 min

    One settings file sends Claude Code to Z.ai and maps each of its model slots to a GLM model.

    1. Open ~/.claude/settings.json in a text editor. On Windows, it's %USERPROFILE%\.claude\settings.json.
    2. Add the keys below to the env block, and keep any other settings already in the file.
    3. Put your key in place of [YOUR CODING PLAN KEY] and save.
    Your config
    {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "[YOUR CODING PLAN KEY]",
        "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
        "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
        "API_TIMEOUT_MS": "3000000"
      }
    }

    You should see a saved file with the new env keys and your key in ANTHROPIC_AUTH_TOKEN.

    Claude Code ignores the new settings?

    Close every Claude Code window and start it again in a new terminal. Then check the file for a missing or extra comma.

    Rather not edit JSON? Run npx @z_ai/coding-helper and follow its wizard. It needs Node.js 18 or newer and writes these settings for you.

  4. Step 4: Start Claude Code and check the model

    2 min

    A quick check confirms that Claude Code reads your file and talks to GLM-5.3.

    1. Open a new terminal, go to your project with cd, and run claude.
    2. If Claude Code asks whether to use this API key, choose Yes.
    3. Type /status.

    You should see ~/.claude/settings.json as a settings source and a glm-5.3 model on the status screen.

    Claude Code says the [1m] model doesn't exist?

    Your Claude Code is too old for the tag. Run claude update, then start it again.

  5. Step 5: Choose how hard GLM thinks

    1 min

    GLM thinks at full depth by default. A lower level gives faster answers for small edits.

    1. Type /effort and pick a level.
    2. Use max for refactors and design work, and low or high for quick fixes.

    You should see the level you picked when you run /effort status.

    GLM maps medium to high and xhigh to max, so it really has 3 levels: low, high and max.

  6. Step 6: Use the same plan in Cline

    5 min

    One plan covers every supported tool, so your editor can share the same credits.

    1. In VS Code, open the Extensions view, search for cline and install it.
    2. In Cline, choose Use your own API Key and set API Provider to OpenAI Compatible.
    3. Set Base URL to https://api.z.ai/api/coding/paas/v4 and paste your plan key into API Key.
    4. For the model, enter the custom name glm-5.3, uncheck Support Images and set Context Window Size to 1000000.

    You should see Cline answering in its chat panel, using the same plan credits as Claude Code.

    Cline fails when you attach a screenshot?

    GLM-5.3 reads text only. Switch the model to glm-5.3-flash, which reads images, and check Support Images.

You get

Claude Code and Cline both running on GLM-5.3, paid for by one flat-price GLM Coding Plan

Did this guide work for you?

Sources