Skip to content

Configure Codex ​

This page explains how to connect Codex CLI, Codex Desktop, or the Codex IDE extension to the LLMAPI Responses API. Use an API key whose group supports Responses.

Before you configure Codex ​

  1. Create or select a Regular API key on the website's API Key page. It will normally be bound to an OpenAI group.
  2. Call GET /v1/models with that key and confirm that the model you intend to use is available.
  3. Fully quit the Codex CLI, Codex Desktop, or IDE extension you use so that an active client does not overwrite the files.
  4. If Codex is already configured, back up the files and merge the required fields instead of discarding unrelated settings.

config.toml and auth.json contain user-level configuration and credentials. Do not commit them to Git, send them in chat, or expose them in screenshots.

Copy configuration from the website's API Key page ​

The website's API Key page generates configuration from the current key's actual group and public service URL. This is more reliable than hard-coding a model and URL:

  1. Sign in to the website and open the API Key page.
  2. Find the Regular API key and select Use Key.
  3. Select Codex CLI.
  4. Choose the Codex authentication mode and operating system.
  5. Save the generated config.toml and auth.json in the indicated user directory.
  6. Restart the Codex client you use and follow its verification steps below.

The website's API Key page provides compatibility authentication by default and may also offer API Key mode. These modes generate different provider authentication fields. Copy config.toml and auth.json together from the same mode; do not combine them across modes.

If CC Switch is installed, you can use Import to CCS on the website's API Key page to open the import flow. After confirming the import, select Enable in CC Switch. See Configure CC Switch.

File locations ​

Systemconfig.tomlauth.json
macOS / Linux~/.codex/config.toml~/.codex/auth.json
Windows%USERPROFILE%\.codex\config.toml%USERPROFILE%\.codex\auth.json

If Codex has already been used or configured, ~/.codex will normally exist and does not need to be recreated. Run mkdir -p ~/.codex only when the directory is missing and the configuration files cannot be saved.

On Windows, press Win + R and enter %USERPROFILE%\.codex. Create the directory if it does not exist.

These are user-level provider settings. Do not put model_provider, model_providers, or provider authentication in a project's .codex/config.toml.

Manual configuration example ​

The following example matches the compatibility authentication mode generated on the website's API Key page. The service URL and model may vary by deployment or key group. If the generated output differs, use that output and the result of GET /v1/models.

~/.codex/config.toml:

toml
model_provider = "OpenAI"
model = "gpt-5.5"
review_model = "gpt-5.5"
model_reasoning_effort = "xhigh"
windows_wsl_setup_acknowledged = true

[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://api.llmapi.site"
wire_api = "responses"
requires_openai_auth = true

[features]
goals = true

~/.codex/auth.json:

json
{
  "OPENAI_API_KEY": "YOUR_API_KEY"
}

Replace YOUR_API_KEY with the Regular API key. If gpt-5.5 is not returned for this key, change both model and review_model to an available Responses model.

Verify the configuration ​

You can first confirm that the key can list the intended model:

bash
curl https://api.llmapi.site/v1/models \
  -H 'Authorization: Bearer YOUR_API_KEY'

Then verify the client you actually use. You do not need to install Codex CLI just to verify Codex Desktop or an IDE extension.

Codex CLI ​

Confirm that the command is available:

bash
codex --version

Then enter a project directory and run:

bash
codex

Codex Desktop ​

Fully quit and reopen Codex Desktop, create a new task, and confirm that it receives a response.

Codex IDE extension ​

Reload the editor window or restart the editor, create a new task, and confirm that it receives a response.

Troubleshooting ​

SymptomResolution
Codex opens the official sign-in flowCheck that config.toml and auth.json exist in the user directory, both files are valid, and their provider settings came from the same authentication mode.
The API returns 401Check that the key in auth.json is complete and active.
Codex reports that the model does not existQuery GET /v1/models with the same key, set model and review_model to a returned model, or copy a fresh configuration from the website's API Key page.
Changes are ignoredFully quit Codex CLI, Codex Desktop, and the IDE extension, then restart. Confirm that you edited the user directory rather than a project directory.

For current Codex configuration field behavior, see OpenAI's official configuration reference.