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.8040.00
gpt-6-solCodex1.600.168.00
gpt-6.1-solCodex1.600.088.00
gpt-5.5Codex4.000.4024.00
codex-auto-reviewCodex4.000.4024.00
gpt-5.6-solCodex3.200.3216.00
gpt-5.6-terraCodex1.600.169.60
gpt-5.6-lunaCodex0.160.0160.96

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.

The listed GPT-5.5, GPT-5.6, and GPT-6 rates apply to requests with at most 272K input tokens. Above 272K, input and cache rates double and output costs 1.5× for the whole request. Cache writes on GPT-5.6 and GPT-6 cost 1.25× the base input rate. See OpenAI pricing for GPT-5.5, GPT-5.6 Sol, Astra, and GPT-6 Sol.

Fast costs 2× Standard for GPT-5.6 and GPT-6, and 2.5× for short-context GPT-5.5. Flex costs 0.5× for these models. Billing follows the response’s service_tier. If omitted, the channel sends default; explicit auto reserves for possible Fast processing. Tiers without configured prices, including ultrafast, are rejected. See OpenAI Fast pricing.

Built-in Web search costs $0.008 per search and File search costs $0.002 per call after the Codex 0.8× factor, in addition to token usage. Page opens do not add a search-call fee. Hosted Code Interpreter, hosted shell, and image generation tools are unavailable on this channel because their separate usage fees cannot be calculated here. See OpenAI tool pricing.

For GPT-5.5, GPT-5.6, and GPT-6, omitted max_output_tokens defaults to 32,768 (up to 128,000 may be requested explicitly). Built-in search tools on any Codex model default to at most five calls unless max_tool_calls is set. Server-stored context (previous_response_id, conversation, or a prompt ID) and remote file or image references are unavailable for these models and requests with metered tools because their input usage cannot be reserved against your quota.

Retrieved search content is also billed at model input rates. max_tool_calls accepts 0–20. Reservations allow up to 1,050,000 input tokens per possible continuation, including long-context, cache-write, and service-tier pricing, so they can substantially exceed the final bill. Lowering the call limit reduces the temporary reservation. Actual usage is charged and the reservation released on completion.

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. Set model to gpt-6-astra, gpt-6-sol, or gpt-6.1-sol for the GPT-6 family; gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna are also available. 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 | AI Coding Assistant