Connecting Codex CLI
Difficulty ⌨️ Intermediate (requires the command line / terminal) | API format OpenAI / Responses | base_url
https://byesu.si/v1
https://byesu.si/v1gpt-6.1-solCodex is OpenAI's official command-line coding assistant. By default it connects to OpenAI; all we need to do is point its custom base_url at byesu — an AI API gateway with OpenAI-compatible and Anthropic-native endpoints — and fill in your Key. One key covers Claude, GPT-5.6, Grok, Gemini and more, billed pay-as-you-go with no subscription.
Before you start
First go to Console → Tokens and create an API Key (see Quickstart for details). Replace every sk-xxxx below with your own Key.
Step 1: Install Codex
If you haven't installed it yet, pick either option:
npm install -g @openai/codexbrew install codexOnce installed, verify it:
codex --versionStep 2: Configure (choose one)
Option 1: One-click script (fastest, recommended)
We've already written the API address into the script — after running it, just paste your API Key (sk-xxxx) and it will automatically set up ~/.codex/config.toml and auth.json (including required fields like wire_api=responses, disable_response_storage and requires_openai_auth, so you don't have to worry about them). Once configured, skip straight to Step 3.
iex (irm 'https://docs.byesu.si/setup/codex.ps1')curl -fsSL https://docs.byesu.si/setup/codex.sh | bashOption 2: Manual configuration
Codex's configuration lives in the ~/.codex/ directory and needs two files.
① ~/.codex/config.toml — specifies the model and the endpoint:
model = "gpt-6.1-sol" # newest Sol tier, good value; or any model name from the console
model_provider = "byesu"
model_reasoning_effort = "high" # thinking effort: low / medium / high / xhigh / max
disable_response_storage = true # ★ required for third-party gateways, otherwise it may error
[model_providers.byesu]
name = "byesu"
base_url = "https://byesu.si/v1"
wire_api = "responses" # ★ must be responses — Codex uses /v1/responses
requires_openai_auth = true # ★ required, or Codex won't send the key from auth.json (401)② ~/.codex/auth.json — stores your Key:
{
"OPENAI_API_KEY": "sk-your-token"
}🤔 Not sure how to create these two files? (click to expand)
Windows: In C:\Users\YourUsername\.codex\, use "Notepad" to create config.toml and auth.json separately (when using "Save As", set the file type to "All Files"; if there's no .codex folder, create one manually from the address bar).
macOS / Linux: In the terminal, run mkdir -p ~/.codex && open -e ~/.codex/config.toml (on Linux, replace open -e with nano); do the same for auth.json.
The four easiest things to get wrong
wire_apimust beresponses(notchat), otherwise you'll get a 404 / wrong endpoint error.base_urlends with/v1— don't add/responseson top of it.- Don't forget
disable_response_storage = true, otherwise connecting through the gateway may error. - The field name in
auth.jsonis exactlyOPENAI_API_KEY(even though you're entering a byesu token).config.tomlalso needsrequires_openai_auth = true— without it Codex doesn't send that key at all and you get a 401.
Step 3: Run it and verify
Go into any project directory and start it:
codexThen ask it to do something small, like typing "list the files in the current directory". If it answers normally, you're connected ✅

Tips
Adjusting the thinking effort
model_reasoning_effort controls how long the model "thinks":
low: fast and economical, good for simple changesmedium: the default, balancing speed and qualityhigh: complex refactors and hard problems — better quality, but slower and more expensivexhigh/max: the hardest tasks; slowest and most expensive
These are the levels
gpt-6.1-solsupports. Per OpenAI’s documentation it does not acceptminimalornone; for other models, check that model’s official docs.
Switching models
Just edit the model line in config.toml and change it to any available model name from the console.
Stuck?
Check against Common Errors & Solutions to troubleshoot. The most common ones are:
- 401 / invalid token → the Key in
auth.jsonis wrong or in the wrong place, orconfig.tomlis missingrequires_openai_auth = true(details) - Insufficient balance → top up in the console with USDT or Alipay (details)
- No available channel → this model isn't in your group; switch to another model (details)
