Codex configuration

Use Codex through the dedicated Codex channel. Create a dashboard API key, choose Codex as its channel, and use that key in your client. Codex consumes purchased quota at 0.8× speed; it does not change the amount of quota you purchased.

Codex keys support GPT/Codex models only. AWSQ and CCMAX keys must use the Anthropic-compatible endpoint, while Gemini keys must use /api/gemini.

Supported models and rates

ModelChannelInputCacheOutput
gpt-6-astraCodex8.000.8048.00
gpt-5.5Codex4.000.4024.00
gpt-5.6-solCodex4.000.4024.00
gpt-5.6-terraCodex2.000.2012.00
gpt-5.6-lunaCodex0.800.084.80

Prices are the effective Codex-channel rates in USD per 1M tokens (the upstream rates multiplied by the channel's 0.8× consumption factor). The same purchased quota is shared across requests made with the key.

Codex CLI

Install the official Codex CLI with Node.js 18 or newer:

1
npm install -g @openai/codex
2
codex --version

The CLI reads configuration from ~/.codex on macOS/Linux and C:\Users\YourUserName\.codex on Windows. Create the directory once if it does not exist.

config.toml

Create config.toml in that directory:

1
model_provider = "aiinide"
2
model = "gpt-5.5"
3
model_reasoning_effort = "high"
4
disable_response_storage = true
5
 
6
[model_providers.aiinide]
7
name = "AI in IDE"
8
base_url = "https://aiinide.com/api/codex"
9
wire_api = "responses"
10
requires_openai_auth = true
11
 
12
[features]
13
web_search_request = true

gpt-5.5 is the default Codex model. Change model to gpt-6-astra for the newest model, or to gpt-5.6-sol, gpt-5.6-terra, or gpt-5.6-luna for lower-cost options. The base URL must stop at /api/codex; the CLI appends /responses.

auth.json

Create auth.json in the same directory and paste the API key generated in your dashboard:

1
{
2
  "OPENAI_API_KEY": "YOUR_DASHBOARD_API_KEY"
3
}

Do not put the server's upstream CODEX_API_KEY in a client. The dashboard key is the only key your CLI or editor should use.

Start Codex

Run Codex from your project directory:

1
cd your-project
2
codex

The official VS Code Codex extension can use the same config.toml and auth.json files. If it reports a missing configuration, verify the file locations and that the selected key is a Codex key.

Responses API

The Responses endpoint is:

1
POST https://aiinide.com/api/codex/responses

Example request:

1
export CODEX_API_KEY="YOUR_DASHBOARD_API_KEY"
2
 
3
curl https://aiinide.com/api/codex/responses \
4
  -H "Authorization: Bearer $CODEX_API_KEY" \
5
  -H "Content-Type: application/json" \
6
  -d '{
7
    "model": "gpt-6-astra",
8
    "input": "Explain this repository in three bullet points.",
9
    "reasoning": {"effort": "high"}
10
  }'

For a streamed response, add "stream": true and keep the connection open:

1
curl -N https://aiinide.com/api/codex/responses \
2
  -H "Authorization: Bearer $CODEX_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "model": "gpt-6-astra",
6
    "input": "Summarize this code.",
7
    "stream": true
8
  }'

Chat Completions

OpenAI-compatible clients that use Chat Completions can call:

1
curl https://aiinide.com/api/codex/chat/completions \
2
  -H "Authorization: Bearer $CODEX_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "model": "gpt-5.6-terra",
6
    "messages": [{"role": "user", "content": "Give me a short release checklist."}],
7
    "stream": false
8
  }'

The endpoint validates the dashboard key's channel and model, forwards the request to the configured Codex upstream, and records usage after the response. Do not send Codex requests to /api/anthropic.

Troubleshooting

  • 401: use a valid, non-expired dashboard key and send it as Authorization: Bearer ....
  • 400: check the model name, request format, and make sure the key belongs to the Codex channel. AWSQ/CCMAX keys cannot use this endpoint.
  • 429: the key's purchased quota, dollar quota, or request limit has been reached.
  • 503: the Codex upstream is temporarily unavailable; retry later.
Codex configuration - AI in IDE Documentation | AI in IDE | Affordable AI Coding in Your IDE