Connect
Codex (GPT)
Connect OpenAI's Codex CLI to CoreCode's GPT group. Codex reads its settings from config.toml; add a custom model provider there. The settings come from OpenAI's Codex advanced configuration guide.
https://corecode.live/v1wire_api = "responses")Install
Skip this if Codex is already installed.
curl -fsSL https://chatgpt.com/codex/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
npm install -g @openai/codex
Run codex --version afterwards; a version number means it is installed. The install options are in the Codex repository.
Create a key
On the API Keys page, click "Create API key" and choose the GPT group; leave the rest as is. A key in a 「Claude 满血」 group cannot call GPT models. To share one key between Claude Code and Codex, choose auto; see the auto group.
Configure
Write config.toml
Edit ~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows), creating it if needed. If the file has content, put the model and model_provider lines at the top, before any table header:
model = "gpt-6.1-sol"
model_provider = "corecode"
[model_providers.corecode]
name = "CoreCode"
base_url = "https://corecode.live/v1"
env_key = "CORECODE_API_KEY"
wire_api = "responses"
| Setting | What it does |
|---|---|
model | The default model; any model in the GPT group |
model_provider | Points at the provider defined below. It cannot be openai, which is Codex's built-in name |
base_url | Must end in /v1 |
env_key | The environment variable Codex reads the key from |
Set the key variable
export CORECODE_API_KEY=sk-your-key
codex
$env:CORECODE_API_KEY = "sk-your-key"
codex
To keep it, add the export line to ~/.zshrc or ~/.bashrc; on Windows run setx CORECODE_API_KEY sk-your-key and open a new terminal.
model_provider and model_providers in a project's .codex/config.toml and prints a warning at startup. The provider has to be in ~/.codex/config.toml.Check that it works
codex exec "reply ok"
If it prints ok, you are connected. The request appears in the console's usage logs under the GPT group.
Change the model
For one run, start with codex --model gpt-6-sol; to change the default, edit model in config.toml. The GPT group's models and prices are in Pricing; from cheapest to most expensive the tiers run roughly luna, terra, sol, astra.
FAQ
401 or a sign-in prompt
Check that the terminal running codex has CORECODE_API_KEY set (echo $CORECODE_API_KEY) and that env_key in config.toml names the same variable. After setx, open a new terminal.
404 or cannot connect
Set base_url to https://corecode.live/v1, including /v1.
Model not found or no available channel
The key must be in the GPT or auto group, and the model name must match the Pricing page.