Connect Codex, Claude Code and the API
codex.sale is an independent API service for GPT, Claude, GLM and DeepSeek. This guide is public. Create your personal API key in the dashboard before sending requests.
1. Get an API key
Sign in, top up your balance and open API key settings. Treat your key like a password and keep it out of public repositories. Ready-to-use installers for your client and operating system are available in the dashboard setup guides.
2. API endpoint and models
https://codex.sale/v1Use Authorization: Bearer YOUR_API_KEY. Request GET /v1/models to discover the models available to your key. Send model names exactly as returned in the id field.
3. Codex CLI and VS Code
Back up your existing ~/.codex/config.toml before editing it. On Windows the file is under %USERPROFILE%\.codex\config.toml. Preserve your other settings.
model = "gpt-6.1-sol"
model_provider = "codex-sale"
[model_providers.codex-sale]
name = "codex.sale"
base_url = "https://codex.sale/v1"
wire_api = "responses"
env_key = "CODEX_SALE_API_KEY"
supports_websockets = falseSet CODEX_SALE_API_KEY in the environment from which you launch the client. Replace the placeholder with your own key.
macOS and Linux
export CODEX_SALE_API_KEY="YOUR_API_KEY"
codexWindows PowerShell
$env:CODEX_SALE_API_KEY="YOUR_API_KEY"
codexThese commands set the key for the current terminal. Fully quit VS Code and launch it from that terminal so the extension receives the same environment.
4. Claude Code
Claude Code uses the Anthropic-compatible endpoint. Its base URL is https://codex.sale; the client appends /v1/messages. Select a Claude model available to your key.
macOS and Linux
export ANTHROPIC_BASE_URL="https://codex.sale"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="claude-opus-5-5"
claudeWindows PowerShell
$env:ANTHROPIC_BASE_URL="https://codex.sale"
$env:ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
$env:ANTHROPIC_MODEL="claude-opus-5-5"
claudeUse the dashboard installer to save your settings or configure Claude Desktop.
5. Your first API request
The following example uses a bash-compatible terminal and the environment variable set above.
curl https://codex.sale/v1/responses \
-H "Authorization: Bearer $CODEX_SALE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","input":"Hello","stream":true}'List available models:
curl https://codex.sale/v1/models \
-H "Authorization: Bearer $CODEX_SALE_API_KEY"Troubleshooting
Check the endpoint, API key, balance and exact model ID. Never send your key in a support message. Use the support contacts for help.