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

# Codex CLI

> Add RedPill as a custom Responses provider in Codex CLI

Codex supports custom model providers in `~/.codex/config.toml`. RedPill's Responses API is the
native wire protocol for this integration.

## Configure

Export your key:

```bash theme={null}
export REDPILL_AI_API_KEY="YOUR_API_KEY"
```

Add the provider to your user-level Codex configuration:

```toml ~/.codex/config.toml theme={null}
model = "openai/gpt-5.6-sol"
model_provider = "redpill"

[model_providers.redpill]
name = "RedPill AI"
base_url = "https://api.redpill.ai/v1"
env_key = "REDPILL_AI_API_KEY"
wire_api = "responses"
```

Provider and authentication settings belong in the user-level file. Codex ignores
`model_provider` and `model_providers` in a project-local `.codex/config.toml`.

## Run

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

The example uses a coding-focused standard model. Query [`GET /v1/models`](/api-reference/models)
before changing it, and run one bounded tool task to check model-specific Responses behavior.

For confidential execution, select an `is_tee: true` model with tool support and change
`base_url` to `https://tee.redpill.ai/v1`. The TEE-only endpoint rejects standard models.

Codex's custom-provider configuration is base-URL-only and does not verify ACI locally. See
[Verified ACI clients](/guides/verified-aci-client) for the required transport boundary.

## Troubleshooting

| Symptom                               | Check                                                         |
| ------------------------------------- | ------------------------------------------------------------- |
| Codex still uses the default provider | Confirm `model_provider = "redpill"` is at the top level.     |
| API key is missing                    | Export `REDPILL_AI_API_KEY` in the shell that launches Codex. |
| Chat works but tools fail             | Test another model that declares `tools` in the live catalog. |

## References

* [Codex custom model providers](https://learn.chatgpt.com/docs/config-file/config-advanced#custom-model-providers)
* [RedPill Responses API](/api-reference/responses)
* [RedPill model catalog](/api-reference/models)
