Codex CLI

Codex CLI supports custom model providers through the Responses API. A separate profile keeps Mixlayer isolated from your default Codex configuration.

Create a Mixlayer API key

Create an API key in the Mixlayer console, then export it in your shell:

$export MIXLAYER_API_KEY="..."

See API Keys for more details on creating and managing keys.

Create a Mixlayer profile

Save the following as ~/.codex/mixlayer.config.toml:

1model = "z-ai/glm-5.2"
2model_provider = "mixlayer"
3model_context_window = 262144
4model_reasoning_effort = "high"
5model_reasoning_summary = "none"
6model_supports_reasoning_summaries = false
7
8[model_providers.mixlayer]
9name = "Mixlayer"
10base_url = "https://models.mixlayer.ai/v1"
11env_key = "MIXLAYER_API_KEY"
12wire_api = "responses"

This uses GLM 5.2, a 256K-context model suited to long-horizon coding, difficult reasoning, and tool-driven tasks. You can replace the identifier and context window with another model from the Models section.

Start Codex

$codex --profile mixlayer

Your normal ~/.codex/config.toml remains unchanged.

Verify

Inside Codex, run:

/status

Confirm that the active model is z-ai/glm-5.2 and the model provider is mixlayer.