DocsClient setupConfigure Codex Manually

Configure Codex Manually

Connect Codex to SoleAPI permanently through its configuration file, without CC Switch.

Configure Codex Manually

This guide connects Codex to SoleAPI permanently through its config.toml configuration file. Before you begin, create an API Key in the console.

This guide applies to both Codex CLI and ChatGPT. The former Codex desktop app has been merged into ChatGPT; use Codex from ChatGPT on desktop.

Quick configuration

Edit ~/.codex/config.toml, then replace the API Key and model as needed:

toml
model_provider = "soleapi"
# Model catalog (optional)
# model_catalog_json = "catalog file"

[model_providers.soleapi]
name = "SoleAPI"
base_url = "https://soleapi.com/v1"
experimental_bearer_token = "sk-sole-your-key"
wire_api = "responses"

Step-by-step guide

  1. Open the Codex configuration directory
  • Windows: C:\Users\your-username\.codex
  • macOS: /Users/your-username/.codex
  • Linux: /home/your-username/.codex

On Windows, press Win + R, enter explorer %userprofile%\.codex, and press Enter to open the directory in File Explorer.

On Linux/macOS, run cd ~/.codex in a terminal.

  1. Confirm that the configuration file exists

The required file is named config.toml. Create it if it does not exist. If it already exists, consider making a backup first.

  1. Edit the configuration file

Merge the following content into config.toml. Replace sk-sole-your-key with your API Key and set model to the desired model ID:

toml
model_provider = "soleapi"
model = "gpt-5.6-sol"

[model_providers.soleapi]
name = "SoleAPI"
base_url = "https://soleapi.com/v1"
experimental_bearer_token = "sk-sole-your-key"
wire_api = "responses"

base_url must be https://soleapi.com/v1, without a trailing /.

If config.toml already contains other settings, keep them and merge or update only model_provider, model, and [model_providers.soleapi].
Back up the configuration file before editing it.

  1. Verify the configuration

Save the file, completely quit Codex, and restart it. Send a message; receiving a normal response confirms that the configuration works.

By default, closing the ChatGPT window only minimizes the app to the system tray. Right-click the tray icon, select Quit, and then restart the app for the configuration to take effect.


Troubleshooting

  • The server returns 404: confirm that base_url is https://soleapi.com/v1.
  • The request path contains a double slash: remove the trailing / from base_url.
  • The server returns 401: check that experimental_bearer_token is complete and that the API Key is still valid.