Skip to main content

Codex CLI

Connect OpenAI’s Codex CLI to ShuYou and call GPT and other OpenAI-compatible models from the terminal with one API key.

Prerequisites

  1. Install Node.js LTS (v20+). Verify with node -v and npm -v.
  2. Create a ShuYou API key in the console.
ShuYou OpenAI-compatible base URL: https://api.shuyou.ai/v1

Step 1: Install Codex CLI

Step 2: Configure ShuYou

Edit ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml):
Set your API key:
Add the same line to ~/.zshrc or ~/.bashrc for persistence.

Step 3: Verify

FAQ

401 / 403: Check OPENAI_API_KEY and that the model slug exists on ShuYou. Config not applied: Restart the terminal and validate TOML syntax in config.toml. Switch models: Change the model field in config.toml and restart Codex.
Use Codex in a dedicated project folder. Avoid directories with secrets or system files.