Skip to content

Use GLM-5.3 With Codex CLI on Windows

Configure Codex CLI to use GLM-5.3 through Z.AI's Responses-compatible endpoint, with the current model ID, config.toml provider, and Windows or WSL setup.

MGMCSA Guru Team August 2, 2026 2 min read
Codex CLI configured to use GLM-5.3 through Z.AI

Codex can call GLM-5.3 through Z.AI’s OpenAI Responses-compatible endpoint. The provider belongs in ~/.codex/config.toml, while the API key stays in an environment variable.

GLM-5.3 is a text-only reasoning model with a 1-million-token context window. It always reasons and supports low, high, and max effort levels. The Codex client decides which provider features it can expose through a custom model.

Install Codex and create a Z.AI key

Use the current Codex Windows and WSL installation guide, then create a key in the Z.AI console for the service you intend to use.

If you have a GLM Coding Plan, follow Z.AI’s supported-tool rules. Coding Plan quota is not general application API credit.

Add the provider to config.toml

Open ~/.codex/config.toml and merge in this configuration:

model = "glm-5.3"
model_provider = "zai"

[model_providers.zai]
name = "Z.AI"
base_url = "https://api.z.ai/api/v1"
env_key = "ZAI_API_KEY"
wire_api = "responses"

Z.AI lists https://api.z.ai/api/v1 for the OpenAI Responses protocol. Do not use the Anthropic endpoint in Codex.

Export the key

In WSL or another POSIX shell:

export ZAI_API_KEY="YOUR_ZAI_API_KEY"
codex

In PowerShell:

$env:ZAI_API_KEY = "YOUR_ZAI_API_KEY"
codex

This sets the key only for the current terminal session. Use your normal secret-management method if you need it to persist. Do not put the raw key in config.toml or commit it to a repository.

Verify the provider

Start Codex in a small test repository and ask it to inspect a file before making a limited edit. If the provider is configured correctly, the request will use glm-5.3 through the zai provider.

If a request fails, check these items:

  • A 401 or authentication error usually means ZAI_API_KEY is missing from the terminal that launched Codex.
  • A model error usually means the model ID is misspelled. Use glm-5.3.
  • A protocol or route error usually means the base URL and wire_api do not match. Use /api/v1 with responses.
  • Image prompts will not work because GLM-5.3 currently accepts text only.

GLM-5.3 Codex check

  • Install a current Codex CLI release
  • Create a Z.AI key for the intended service
  • Set the provider base URL to https://api.z.ai/api/v1
  • Set wire_api to responses and model to glm-5.3
  • Export ZAI_API_KEY before starting Codex

This setup keeps the provider details separate from the secret and uses Z.AI’s current Responses route. If Z.AI changes the model later, update the model name only after checking its migration notes for protocol or reasoning changes.

For a direct Anthropic-format connection, see GLM-5.3 with Claude Code. For provider configuration in general, see Codex custom providers.

Frequently asked questions

Can Codex CLI use GLM-5.3?

Yes. Z.AI publishes an OpenAI Responses-compatible endpoint, and Codex supports custom model providers in config.toml.

Which Z.AI endpoint should Codex use?

Use https://api.z.ai/api/v1 with wire_api set to responses. The /anthropic endpoint is for tools such as Claude Code.

What is the GLM-5.3 model ID?

Use glm-5.3 in lowercase.

Does GLM-5.3 support image input in Codex?

No. Z.AI currently documents GLM-5.3 as text-only.

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.