DocsClient setupCodex

Codex

Install Codex and connect it to SoleAPI permanently through its configuration file.

Codex

This guide connects Codex to SoleAPI permanently through its config.toml configuration file. If you prefer a graphical setup, you can use the more convenient CC Switch. Before you begin, create an API Key in the console.

Install Codex

Install the command-line version (CLI)

This section installs codex-cli through npm, which is included with Node.js.

  1. Make sure your Node.js version is at least v22. Check it by running:
bash
node -v

Show the local Node.js version

If your version is below v22 or Node.js is not installed, get it from the Node.js download page.

Show the download page

  1. Install @openai/codex with npm
bash
npm install -g @openai/codex

Install the Windows graphical version (ChatGPT)

Codex is now integrated into the ChatGPT application. Switch to Codex from the upper-left corner of the ChatGPT app:

Connect Codex to SoleAPI

  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 to enter the directory.

  1. Confirm that the configuration file exists

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

  1. Edit the configuration file

Merge the following into config.toml. Replace sk-sole-your-key with your own API Key and set model to the model ID you want to use:

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 file before editing it.

  1. Verify the configuration

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

The ChatGPT application normally minimizes to the system tray when its window is closed. Right-click the tray icon and select Quit before restarting the application so the configuration takes effect.


Frequently asked questions

  • The request returns 404: confirm that base_url is https://soleapi.com/v1.
  • The request path contains double slashes: 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.