Codex
Use aicentos in Codex — one-click import with CC Switch, or configure config.toml manually
Last updated:
Codex is compatible with the OpenAI protocol. Point the model provider at aicentos and you can use every model aicentos offers.
Two integration options are provided below: manage everything with CC Switch (recommended), or edit config.toml manually.
Option 1: Use CC Switch (recommended)
CC Switch can also manage Codex's provider configuration, letting you switch between multiple setups in one click.
Option 2: Manual configuration
Prerequisites
| Item | Value |
|---|---|
| Provider ID | aicentos |
| Provider name | aicentos |
| Base URL | https://aicentos.com/v1 |
| API Key environment variable | AICENTOS_API_KEY |
First create a dedicated key on the console's "API Keys" page; including codex in the name makes usage easier to track.
Set the API Key
Set the environment variable in your terminal:
export AICENTOS_API_KEY="sk-your-API-Key"To persist it, add the line to ~/.zshrc or ~/.bashrc, then reload:
source ~/.zshrcConfirm the variable is active:
echo $AICENTOS_API_KEYConfigure the Codex provider
Edit ~/.codex/config.toml and add:
model = "your-model-name"
model_provider = "aicentos"
[model_providers.aicentos]
name = "aicentos"
base_url = "https://aicentos.com/v1"
env_key = "AICENTOS_API_KEY"
wire_api = "responses"Replace your-model-name with a model name listed in the Model Gallery of the console; see Supported models.
Launch Codex
codexSend a simple request to confirm the provider works.
Troubleshooting
When a request fails, compare Codex's terminal output with the usage logs in the console. Common causes:
- The model name is wrong (follow the Model Gallery).
- The Base URL format is wrong (fill in only up to
/v1; do not add extra paths). - The environment variable was not picked up by the current terminal (reopen the terminal or
sourcethe config file).