Skip to content

Connecting Codex CLI ​

Difficulty ⌨️ Intermediate (requires the command line / terminal) | API format OpenAI / Responses | base_url https://byesu.si/v1

Setup · fill these in
API addresshttps://byesu.si/v1
API keysk-xxxxxxxxCreate in console →
Modelgpt-6.1-sol
API format OpenAI compatible · model names follow the console

Codex 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:

bash
npm install -g @openai/codex
bash
brew install codex

Once installed, verify it:

bash
codex --version

Step 2: Configure (choose one) ​

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.

powershell
iex (irm 'https://docs.byesu.si/setup/codex.ps1')
bash
curl -fsSL https://docs.byesu.si/setup/codex.sh | bash

Option 2: Manual configuration ​

Codex's configuration lives in the ~/.codex/ directory and needs two files.

① ~/.codex/config.toml — specifies the model and the endpoint:

toml
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:

json
{
  "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

  1. wire_api must be responses (not chat), otherwise you'll get a 404 / wrong endpoint error.
  2. base_url ends with /v1 — don't add /responses on top of it.
  3. Don't forget disable_response_storage = true, otherwise connecting through the gateway may error.
  4. The field name in auth.json is exactly OPENAI_API_KEY (even though you're entering a byesu token). config.toml also needs requires_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:

bash
codex

Then ask it to do something small, like typing "list the files in the current directory". If it answers normally, you're connected ✅

Codex running normally

Tips ​

Adjusting the thinking effort ​

model_reasoning_effort controls how long the model "thinks":

  • low: fast and economical, good for simple changes
  • medium: the default, balancing speed and quality
  • high: complex refactors and hard problems — better quality, but slower and more expensive
  • xhigh / max: the hardest tasks; slowest and most expensive

These are the levels gpt-6.1-sol supports. Per OpenAI’s documentation it does not accept minimal or none; 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.json is wrong or in the wrong place, or config.toml is missing requires_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)

Got a problem? Contact support or join our group.