Source: https://ailoot.ai/docs/integrations/openai-codex-cli/
Canonical: https://ailoot.ai/docs/en/integrations/openai-codex-cli/
Language: en

[Terminal agents](https://ailoot.ai/docs/en/integrations/#agents) 

# OpenAI Codex CLI

[Markdown](https://ailoot.ai/docs/en/integrations/openai-codex-cli/index.md)

Terminal agent · OpenAI Responses

| Format | Where to set it up |
| --- | --- |
| OpenAI Responses | ~/.codex/config.toml (the user-level file only: model\_provider/model\_providers are ignored in a project’s .codex/config.toml); the key goes in the variable named by env\_key |

## [](https://ailoot.ai/docs/integrations/openai-codex-cli/#setup)Setup

Copy the configuration and replace `sk-...` with your key from the Ailoot Dashboard. Prefer storing the key in the environment variable `AILOOT_API_KEY`, if the application supports it.

Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1/responses, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.

`~/.codex/config.toml`

```toml
model = "gpt-6.1-sol"
model_provider = "ailoot"

[model_providers.ailoot]
name = "Ailoot"
base_url = "https://api.ailoot.ai/v1"
env_key = "AILOOT_API_KEY"
wire_api = "responses"
```

```bash
export AILOOT_API_KEY="sk-..."
codex
```

Example model: `gpt-6.1-sol`. Choose any other model from the [catalog](https://ailoot.ai/models/en/) — check that it supports the format you need.

## [](https://ailoot.ai/docs/integrations/openai-codex-cli/#notes)Good to know

Codex uses only the OpenAI Responses API: the documentation lists only wire\_api = "responses", so it needs our /v1/responses. Provider IDs openai, ollama, and lmstudio are reserved. Alternatively, use openai\_base\_url = "https://api.ailoot.ai/v1" with the built-in openai provider. Ailoot returns the model list in Codex manifest format through GET /v1/models with client\_version. Choose a specific model whose catalog entry lists OpenAI Responses. In the 2026-09-30 snapshot, gemini-3.6-flash has OpenAI Chat, Anthropic Messages, and Gemini, but no Responses, so it is unsuitable for Codex. Check formats on the model card, not from the family name.

## [](https://ailoot.ai/docs/integrations/openai-codex-cli/#check)Test

- For the OpenAI format, the URL is `https://api.ailoot.ai/v1` (or the full path if the application asks for a full URL).
- Ask a short question. If you get an error, check the code and Request ID, then consult [Errors and limits](https://ailoot.ai/docs/en/errors/).
- 404 immediately after setup almost always means the URL is wrong: an extra or missing `/v1`.
- 402 — insufficient balance for the reserve. Agents reserve more than chat: [why](https://ailoot.ai/docs/en/billing/reserve/).

Application documentation: [https://learn.chatgpt.com/docs/config-file/config-advanced](https://learn.chatgpt.com/docs/config-file/config-advanced)

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.[Contact support](mailto:support@ailoot.ai)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
