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:

model = "z-ai/glm-5.2"
model_provider = "mixlayer"
model_context_window = 262144
model_reasoning_effort = "high"
model_reasoning_summary = "none"
model_supports_reasoning_summaries = false
[model_providers.mixlayer]
name = "Mixlayer"
base_url = "https://models.mixlayer.ai/v1"
env_key = "MIXLAYER_API_KEY"
wire_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.