Codex CLI
Use Cortecs models with Codex CLI
Codex CLI is OpenAI's terminal-based coding agent. Connect it to Cortecs through the OpenAI-compatible Responses API.
1. Install Codex CLI
On macOS, Linux, or WSL:
curl -fsSL https://chatgpt.com/codex/install.sh | shAlternatively, install Codex CLI with npm:
npm install -g @openai/codexSee the Codex CLI documentation for othe platforms.
2. Add Cortecs
Create or update ~/.codex/config.toml:
model = "<MODEL_ID>"
model_provider = "cortecs"
[model_providers.cortecs]
name = "Cortecs"
base_url = "https://api.cortecs.ai/v1"
experimental_bearer_token = "<CORTECS_API_KEY>"
wire_api = "responses"Replace <MODEL_ID> with the exact ID from the model catalog and <CORTECS_API_KEY> with your generated key. For more options, see the Codex configuration reference.
3. Start Codex CLI
Launch Codex within your desired project directory:
Run /status inside Codex to confirm that the active model and provider are set to Cortecs.
Troubleshooting
Web search rejection
Some of the provided models may reject Codex's web search tool. Disable web search for a single run when using an affected model:
To disable it for every Codex session, add this top-level setting to ~/.codex/config.toml:
Place the setting outside [model_providers.cortecs], then restart Codex.
Unsupported reasoning effort
Reasoning levels vary by model and provider. For some models is necessary to provide the reasoning level upon launch.
Use a supported value for a single run:
To set the value for every Codex session, add it as a top-level setting in ~/.codex/config.toml.
Last updated