Skip to main content
Codex CLI talks to NagaAI through /v1/responses. Install it from the official repository, then add a custom provider. The keys below follow the Codex configuration reference.

Configure

Codex reads custom providers only from ~/.codex/config.toml, not from a project .codex/config.toml.
Then export the key and start Codex:

How Codex works through NagaAI

Codex sends its own tool formats: apply_patch as a freeform tool, MCP tools grouped by server, and a compact tool list for gpt-6-* and gpt-5.6-*. NagaAI passes all of them to the model and returns the calls in Codex’s item types, so file editing and MCP tools work. Remote compaction is off for custom providers, and Codex compacts the conversation locally. model_context_window tells Codex the window of a model it does not know. Take the value from context_window in /v1/models.