Codex CLI

Configure Codex CLI to use Essevin's OpenAI Responses compatible API.

Codex CLI is OpenAI's coding agent. One-click setup is recommended; manual setup needs config.toml and OPENAI_API_KEY.

Use a GPT key

Sign in to the console, open API keys, and find a key whose purpose is GPT — or click New key, enter a name, and pick GPT under Use with.

Generate the setup command

Select One-Click Setup, then choose Codex CLI and your operating system.

Run and verify

Run the command in a terminal. When it completes, reopen the terminal and run codex.

For a graphical setup, follow the CC Switch guide, select Import CCS from the key menu, and choose Codex CLI.

Manual setup: edit config.toml

SystemConfiguration file
macOS / Linux~/.codex/config.toml
WindowsC:\Users\your-name\.codex\config.toml

Create the file if it does not exist, then add:

model_provider = "essevin"
model = "gpt-6-sol"

[model_providers.essevin]
name = "Essevin"
base_url = "https://api.essevin.com/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"

Do not mix the two key methods

Manual setup reads the key from an environment variable through env_key; one-click setup uses requires_openai_auth = true with auth.json. Do not combine requires_openai_auth = true with the environment-variable method in one configuration: in Codex 0.153 testing, that combination sends no key and the gateway returns 401 missing_api_key.

Set the key and start Codex:

Temporary settings apply only to the current terminal window:

export OPENAI_API_KEY=sk-your-key
codex

Persistent settings belong in your shell startup file:

# zsh (the macOS default)
echo 'export OPENAI_API_KEY=sk-your-key' >> ~/.zshrc
source ~/.zshrc

# bash (common on Linux; use this instead of the zsh block)
echo 'export OPENAI_API_KEY=sk-your-key' >> ~/.bashrc
source ~/.bashrc

Web search and remote compaction are not supported

Codex web search requests /v1/alpha/search, and remote context compaction requests /v1/responses/compact. Neither endpoint is supported yet; both return 404. The web-search 404 does not affect normal conversations. Turn off web search in Codex if you do not want to see it.

Use a GPT key

Use a key created with the GPT purpose; a Claude key does not work with Codex.See Troubleshooting when setup fails.

On this page