Updated:

Codex Setup

Codex is an official command-line tool provided by OpenAI. Through the Cubence platform, you can use powerful models like GPT-5.

Base URL and routes

The examples use the Mainland China route, https://api-lb.cubence.ai/v1. For global use, set the Base URL to https://api.cubence.ai/v1; outside Mainland China, you can use https://api.cubence.com/v1. Keep /v1 and any request path when switching routes. See API endpoints and Base URL configuration.


Installation

npm install -g @openai/codex

Configuration

Open Configuration Directory

Go to the .codex folder in your user directory: C:\Users\YourUsername\.codex

If you cannot see the folder, you need to enable "Show hidden items" in File Explorer. If the folder doesn't exist, create it manually.

Create config.toml

Create config.toml file:

config.toml
model_provider = "cubence"
model = "gpt-5.5"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.cubence]
name = "cubence"
base_url = "https://api-lb.cubence.ai/v1"
wire_api = "responses"
requires_openai_auth = true

Create auth.json

Create auth.json file:

auth.json
{
"OPENAI_API_KEY": "your-api-key-here"
}

Please replace your-api-key-here with the API Key created on the Cubence platform.

Verify Configuration

Run codex in the terminal to verify the configuration.


Advanced reading

Codex context management: setup and usage: configuration, eligibility, and troubleshooting. This experiment does not support the Cubence custom provider.

Having Issues?

Check the FAQ, or get help through pre-sales and after-sales support.