> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Codex CLI

> Use Mixlayer in Codex CLI with a separate profile

[Codex CLI](https://developers.openai.com/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](https://console.mixlayer.com/app/api-keys), then export it in your shell:

```bash
export MIXLAYER_API_KEY="..."
```

See [API Keys](/api-keys) for more details on creating and managing keys.

## Create a Mixlayer profile

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

```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://mixlayer.ai/v1"
env_key = "MIXLAYER_API_KEY"
wire_api = "responses"
```

This uses [GLM 5.2](/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](/models) section.

## Start Codex

```bash
codex --profile mixlayer
```

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

## Verify

Inside Codex, run:

```text
/status
```

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