Configure Codex CLI with Earbowe API
Point OpenAI Codex CLI at api.earbowe.com/v1 — full setup with environment variables and verification.
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
export OPENAI_BASE_URL="https://api.earbowe.com/v1"export OPENAI_API_KEY="sk-YOUR-KEY"For China-direct access:
export OPENAI_BASE_URL="https://api.3861343.xyz/v1"export OPENAI_API_KEY="sk-YOUR-KEY"2. Verify the connection
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
codexCodex 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-optimizedgpt-5.5— latest GPTclaude-sonnet-4-20250514— Anthropic’s coding modeldeepseek-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 |