Skip to content

Codex Setup ​

Codex is OpenAI's terminal coding agent. Clauddy is compatible with the OpenAI Responses API, so it connects directly.

Cheat sheet
API endpointhttps://api.clauddy.com/v1 (must include /v1)
Token groupOpenAI (0.5x, Codex only) or Unified
Recommended modelgpt-6-astra
Config file~/.codex/config.toml, on Windows %USERPROFILE%\.codex\config.toml
Launchcodex

Choose a setup method ​

One-click script ​

bash
curl -fsSL https://docs.clauddy.com/install.sh | bash -s -- --lang en
  1. Type 2 in the menu for Codex CLI. If it is not installed, the script offers to install it.
  2. Create a token in the OpenAI group when prompted and paste it. The script validates it live.
  3. Open a new terminal and run codex.

The script does not run in Windows PowerShell / CMD. Use CC Switch or the manual setup below. Script details →

Install Codex ​

Script and CC Switch users can skip this. The npm route needs Node.js 18+ (environment check).

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

Run codex --version to confirm.

Manual setup ​

A single config.toml holds the endpoint and key. Do not create auth.json.

toml
model_provider = "clauddy"
model = "gpt-6-astra"

[model_providers.clauddy]
name = "clauddy"
base_url = "https://api.clauddy.com/v1"
wire_api = "responses"
experimental_bearer_token = "sk-your-clauddy-token"
toml
model_provider = "clauddy"
model = "gpt-6-astra"

[model_providers.clauddy]
name = "clauddy"
base_url = "https://api.clauddy.com/v1"
wire_api = "responses"
experimental_bearer_token = "sk-your-clauddy-token"
Windows: how to create and open the file
powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex" | Out-Null
notepad "$env:USERPROFILE\.codex\config.toml"
FieldMeaning
base_urlhttps://api.clauddy.com/v1, the /v1 is required
experimental_bearer_tokenYour Clauddy token
modelgpt-6-astra recommended

The old recipe triggers a login screen

requires_openai_auth = true plus auth.json is the old approach. Newer Codex versions respond with "Sign in with ChatGPT". Remove that line and auth.json, and use experimental_bearer_token as above.

The token is stored in plain text in config.toml. Don't share or commit the file. On macOS / Linux run chmod 600 ~/.codex/config.toml.

Verify ​

bash
cd your-project-folder
codex

Send any message. A reply means you are done. Open a new terminal after changing config.

Common issues ​

  • "Sign in with ChatGPT" appears: see the warning above. Remove requires_openai_auth and auth.json.
  • 401 Missing API key: experimental_bearer_token is missing or incomplete.
  • 404 / connection failed: base_url is missing /v1.

More in the Codex FAQ.

Stuck? Let an AI assistant walk you through ​

Copy this and send it to Doubao, ChatGPT, Claude, or any assistant that can read web pages
I want to connect Codex CLI to Clauddy (an AI API platform). Read this tutorial in full first, then walk me through it step by step:
https://docs.clauddy.com/en/cli/codex

Rules:
1. After reading, ask me three things: my operating system (Windows / macOS / Linux), whether Codex CLI is already installed, and whether I already have a Clauddy account and API key.
2. Guide me through ONE step at a time. Wait for my reply before moving on.
3. Use only the URLs, file paths, group names and config values from the tutorial. Do not invent model names, group names or UI options. If the tutorial does not cover something, say "not covered by the tutorial".
4. Before I edit any existing config file, remind me to back it up.
5. Write every example key as sk-xxx. Never ask me to paste my real key to you.
6. You cannot operate my computer. Never claim you changed a file for me. Tell me what to do and I will do it.
7. If a step fails, ask me to paste the full error first, then check it against the tutorial's FAQ section.

Open Doubao ↗ · Read the Codex CLI guide

Clauddy | AI API 聚合平台