Skip to content

Use GLM-5.3 With OpenCode on Windows or WSL

Connect OpenCode to GLM-5.3 with its built-in Z.AI provider, Coding Plan option, current model selection, and verification steps.

MGMCSA Guru Team August 19, 2026 2 min read
OpenCode connected to GLM-5.3 through Z.AI

OpenCode has a built-in Z.AI provider, so you do not need to create a custom provider block for a standard GLM setup. Authenticate from OpenCode, choose the provider that matches your account, and select GLM-5.3.

Install OpenCode

Follow the current OpenCode Windows and WSL guide. Check the installed version before configuring a provider:

opencode --version

Create a Z.AI API key. If you subscribe to the GLM Coding Plan, use the plan key and its dedicated provider selection.

Sign in to Z.AI

Run:

opencode auth login

Choose Z.AI for regular API access. Choose Z.AI Coding Plan if the key belongs to a Coding Plan. Paste the corresponding key when prompted.

Select GLM-5.3

Start OpenCode inside your project:

cd /path/to/project
opencode

Open the model picker:

/models

Select GLM-5.3. Z.AI documents it as text-only with a 1-million-token context window and up to 128,000 output tokens. Reasoning is always enabled.

Test the connection

Begin with a read-only request such as asking OpenCode to explain a small module. Then request one limited edit and inspect the diff. This confirms authentication, model selection, and tool calls before you assign a wider repository task.

If GLM-5.3 does not appear, update OpenCode and repeat the login. You can also verify the live model list in Z.AI’s documentation before manually adding a custom provider.

Common errors

An authentication or balance error often means the selected provider does not match the type of key. Log out of that provider and repeat opencode auth login with the correct Z.AI option.

A missing model usually indicates an older OpenCode release or stale provider metadata. Update OpenCode, restart it, and check /models again.

Do not send images to GLM-5.3. Z.AI lists it as text-only. Choose a supported vision model for image or screenshot work.

GLM-5.3 OpenCode check

  • Install or update OpenCode
  • Create the correct Z.AI API or Coding Plan key
  • Run opencode auth login
  • Select Z.AI or Z.AI Coding Plan to match the key
  • Choose GLM-5.3 with /models and test a small edit

The built-in provider is easier to maintain than an old custom opencode.json block because OpenCode and Z.AI can update the provider metadata without requiring you to rewrite the endpoint configuration.

For Claude Code, see the GLM-5.3 direct setup. For Codex, see GLM-5.3 with Codex CLI.

Frequently asked questions

Does OpenCode have a built-in Z.AI provider?

Yes. Run opencode auth login and select Z.AI. Coding Plan subscribers should select Z.AI Coding Plan.

Which GLM model should I select?

Use glm-5.3 for a new setup. Z.AI currently makes GLM-5.3 available to all Coding Plan users.

How do I change the model in OpenCode?

Run /models inside OpenCode and select GLM-5.3.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.