ZH

Search

Configure Codex CLI with Earbowe API

Point OpenAI Codex CLI at api.earbowe.com/v1 — full setup with environment variables and verification.

Admin2 min read

Configure Codex CLI with Earbowe API

Codex CLI is OpenAI’s terminal-based coding agent. You can point it at any OpenAI-compatible endpoint — including Earbowe.

Setup

1. Set environment variables

Terminal window
export OPENAI_BASE_URL="https://api.earbowe.com/v1"
export OPENAI_API_KEY="sk-YOUR-KEY"

For China-direct access:

Terminal window
export OPENAI_BASE_URL="https://api.3861343.xyz/v1"
export OPENAI_API_KEY="sk-YOUR-KEY"

2. Verify the connection

Terminal window
curl -s "$OPENAI_BASE_URL/models" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
| python3 -c "import sys,json; [print(m['id']) for m in json.load(sys.stdin)['data'][:5]]"

You should see a list of available model IDs.

3. Start Codex

Terminal window
codex

Codex will use the environment variables automatically. No config file needed.

Model selection

Codex works best with strong models. On Earbowe, try:

  • gpt-5.1-codex — Codex-optimized
  • gpt-5.5 — latest GPT
  • claude-sonnet-4-20250514 — Anthropic’s coding model
  • deepseek-v4-pro — cost-effective alternative

Check /v1/models for the current list.

Troubleshooting

Symptom Fix
401 Unauthorized Check your API key — it must start with sk-
model not found Verify the model ID against /v1/models
Connection timeout Try the China-direct endpoint if you’re in Asia
Stream interrupted Earbowe supports streaming; check your network

Next