Codex CLI
Codex CLI uses the OpenAI-compatible API. With QuotaAPI, set the Base URL to https://quotarouter.ai/v1 and authenticate with a Bearer token.
Environment variables
export OPENAI_BASE_URL="https://quotarouter.ai/v1"
export OPENAI_API_KEY="YOUR_QUOTAAPI_KEY"If your tool expects OPENAI_API_BASE, set it to the same URL:
export OPENAI_API_BASE="https://quotarouter.ai/v1"Recommended checks
First confirm that models are reachable:
curl https://quotarouter.ai/v1/models \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY"Then send a Chat Completions request:
curl https://quotarouter.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [
{ "role": "user", "content": "Return a short Codex CLI test response." }
],
"max_tokens": 80
}'Responses API
Clients that support Responses can call /v1/responses:
curl https://quotarouter.ai/v1/responses \
-H "Authorization: Bearer YOUR_QUOTAAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Write one sentence about QuotaAPI.",
"max_output_tokens": 80
}'Some reasoning models consume reasoning tokens before producing visible output. To avoid upstream rejection for an output limit that is too low, use 16 or more for max_output_tokens or max_completion_tokens.
Model names
Common GPT / OpenAI-style model examples:
| Model | Good for |
|---|---|
gpt-5.5 | General reasoning, coding and multi-step tasks |
gpt-5.5-mini | Fast Q&A, lightweight coding help and lower-cost tasks |
Actual availability depends on the console group. If a group is named Codex but uses the OpenAI-compatible protocol, configure it as an OpenAI-compatible client with https://quotarouter.ai/v1.
Troubleshooting
OPENAI_BASE_URLis ignored: check whether the client readsOPENAI_API_BASEor its own config file.401: verify the Bearer token and remove extra spaces.400: check model name, request body and token fields.403: the API Key does not have access to the target OpenAI / GPT group.
