Codex Client
Scope
This guide applies to Codex desktop clients, Codex IDE extensions, and Codex
clients that read the local ~/.codex configuration directory. After setup,
Codex will call models through the 88API relay.
Before You Start
- Sign in to 88API.
- Make sure your account has balance.
- Create an API key in the 88API console.
- Install the Codex client or the related IDE extension.

How It Works
Codex clients read configuration from the local Codex directory:
| File | Purpose |
|---|---|
~/.codex/config.toml | Sets the model, provider, API endpoint, API key, and protocol |
~/.codex/auth.json | OpenAI account login cache; normal 88API setup no longer writes API keys here |
Use the following values for the 88API relay:
| Option | Value |
|---|---|
| API base URL | https://api.88api.ai/v1 |
| API key | The key created in the 88API console |
| Model | gpt-6.1-sol |
| Protocol | responses |
One-Click Setup
Windows
Open PowerShell and run:

The script's prompts are in Chinese; the values are the same as in the text.
Configure Codex Client
The one-click script only writes the 88API configuration for Codex. It does not install a proxy and does not change the system proxy.
curl.exe --ssl-no-revoke -fsSL https://88api.ai/helper/codex-client-setup.ps1 -o "$env:TEMP\codex-client-setup.ps1"
PowerShell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\codex-client-setup.ps1"Enter the following when prompted:
- API base URL (prompt
API 基础地址 [https://api.88api.ai]): press Enter to use the defaulthttps://api.88api.ai; the script adds/v1automatically. - API key: paste the key created in the 88API console (the input is not shown on screen; just press Enter after pasting).
The script writes (or config.toml in the CODEX_HOME directory, if that variable is set):
%USERPROFILE%\.codex\config.tomlWhen it finishes, the terminal shows API 基础地址: https://api.88api.ai/v1 (API base URL) and 已写入: …\config.toml (written to).
Your existing config.toml is overwritten
The script rewrites the whole config.toml with only the 88API settings. Existing MCP servers,
project trust entries, other providers and similar settings are not kept. The script first backs up the
old file as config.toml.bak.<timestamp> (the terminal shows 已备份原配置: …); to keep your old
settings, merge them back manually from the backup.
The script stores the 88API key in the active provider's experimental_bearer_token
instead of relying on auth.json.OPENAI_API_KEY, avoiding
API_KEY_REQUIRED / 401 Unauthorized errors in newer Codex builds.
macOS / Linux
Open Terminal and run:

The script's prompts are in Chinese; the values are the same as in the text.
bash <(curl -fsSL https://88api.ai/helper/codex-client-setup.sh)Enter the following when prompted:
- API base URL (prompt
API 基础地址 [https://api.88api.ai]): press Enter to use the defaulthttps://api.88api.ai; the script adds/v1automatically. - API key: paste the key created in the 88API console (the input is not shown on screen; just press Enter after pasting).
The script writes (or config.toml in the CODEX_HOME directory, if that variable is set):
~/.codex/config.tomlWhen it finishes, the terminal shows API 基础地址: https://api.88api.ai/v1 (API base URL) and 已写入: …/config.toml (written to).
Your existing config.toml is overwritten
The script rewrites the whole config.toml with only the 88API settings. Existing MCP servers,
project trust entries, other providers and similar settings are not kept. The script first backs up the
old file as config.toml.bak.<timestamp> (the terminal shows 已备份原配置: …); to keep your old
settings, merge them back manually from the backup.
The macOS / Linux one-click setup script also uses the provider-scoped experimental_bearer_token and does not
write the 88API key to auth.json.
Manual Setup
You can also create the files manually.
config.toml
Write this to ~/.codex/config.toml:
model = "gpt-6.1-sol"
model_provider = "88api"
model_reasoning_effort = "high"
[model_providers.88api]
name = "88API"
base_url = "https://api.88api.ai/v1"
wire_api = "responses"
supports_websockets = false
experimental_bearer_token = "sk-your-88api-key"auth.json
Do not put the 88API key in auth.json for the current Codex configuration.
Keep auth.json only as the OpenAI account login cache; model requests should
use the provider-scoped experimental_bearer_token in config.toml.
Start the Client
After configuration, reopen the Codex client or restart your IDE.
If the client is already running, fully quit and start it again so it reloads
~/.codex/config.toml and ~/.codex/auth.json.
Verify Requests
- Start a simple task in the Codex client.
- Open the 88API console.
- Check Usage Logs for the corresponding request.

If the request appears in Usage Logs, the Codex client is using the 88API relay.
Troubleshooting
The client still uses the official account
Confirm that the client supports the local ~/.codex configuration. Some
official cloud Codex entries only use ChatGPT account login and do not support a
third-party API endpoint, so they cannot be relayed through 88API.
Authentication failed
Check that experimental_bearer_token under [model_providers.88api] (or your active provider)
in config.toml is complete, with no leading or trailing spaces or line breaks.
If API_KEY_REQUIRED or 401 Unauthorized appears after a ChatGPT / Codex update, re-run the
one-click setup script above so the active provider's experimental_bearer_token is rewritten.
Model unavailable
Confirm that your 88API account can use gpt-6.1-sol (your token's group must include it; if it does not, use gpt-6-astra). If your account uses a
different Codex-compatible model, update the model field in config.toml.
The desktop model picker shows Custom or no models
This is a known display issue in the Codex desktop app with custom providers and does not affect
requests. The model actually used is the model value in config.toml; to switch models, change that
line (for example to gpt-6-astra), then fully quit and reopen the client.
Changes do not take effect
Fully quit the Codex client or IDE and reopen it. If needed, remove old official login cache and run the one-click setup script again.