> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Use the Phaseo Gateway as a custom provider for Codex CLI, Codex App, and the Codex IDE extension.

Codex supports custom model providers through `config.toml`, so you can route Codex requests through Phaseo while keeping the same CLI, app, or IDE workflow.

If you also want Codex to read the live Phaseo documentation while it works, add the [Docs MCP](./docs-mcp.mdx) server as well.

<Note>
  Reusable Phaseo skills are available from [`phaseoteam/skills`](https://github.com/phaseoteam/skills). For Codex installs, use:

  ```bash theme={null}
  npx skills add phaseoteam/skills --agent codex --skill '*'
  ```
</Note>

## Prerequisites

* A Phaseo API key.
* Codex CLI, Codex App, or the Codex IDE extension.

## 1) Set your API key

```bash theme={null}
export PHASEO_API_KEY="your_phaseo_api_key"
```

```powershell theme={null}
$env:PHASEO_API_KEY = "your_phaseo_api_key"
```

## 2) Configure Codex to use Phaseo

Create or update your user config at `~/.codex/config.toml`. For a trusted project, you can also place the same settings in `.codex/config.toml` inside the repo.

```toml theme={null}
model = "openai/gpt-5.5"
model_provider = "phaseo"

[model_providers.phaseo]
name = "Phaseo"
base_url = "https://api.phaseo.ai/v1"
env_key = "PHASEO_API_KEY"
wire_api = "responses"
```

Codex currently uses the Responses wire protocol for custom providers. Keep `wire_api = "responses"` or omit it and use the default.

## 3) Start Codex

```bash theme={null}
codex
```

The Codex App and IDE extension share the same config layers. In the IDE extension, open the config from `Codex Settings > Open config.toml`.

## Verification

* Confirm your model id exists in [Models](../../api-reference/endpoint/models.mdx) before launching.
* Use [Responses](../../api-reference/endpoint/responses.mdx) for the default Codex-style flow.

## Troubleshooting

* `401 Unauthorized`: check that `PHASEO_API_KEY` is set in the same shell running `codex`.
* `model_not_found`: fetch a current id from [Models](../../api-reference/endpoint/models.mdx) and update `model`.
* Provider-specific issues: follow [Routing and fallbacks](../routing-and-fallbacks.mdx) for failover behavior.
