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.

Use a Codex key for GPT models.

Models and current prices

Use a Codex key for the configured GPT models. All model prices lists the available pricing pages; GPT-6.1 Sol vs Terra compares these two models and their compatible reasoning settings.

The current quota rate is AI in IDE's configured model price × the Codex channel factor. It can differ from the provider's reference price. Check the live quota rates on the Sol and Terra pages. Quota consumption is separate from the amount paid to purchase quota; use the cost calculator for a purchase estimate.

Standard 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. Default 30-minute cache writes on GPT-5.6 and GPT-6 cost 1.25× the base input rate. See OpenAI pricing for GPT-5.6 Sol, Astra, and GPT-6 Sol.

GPT-6.1 Terra follows the same context and processing-tier rules. Its base prices are listed in the official model documentation. For GPT-5.6 and GPT-6, 30-minute cache writes cost 1.25× input; 12-hour writes cost 2.5×. Set prompt_cache_options.ttl or a prompt_cache_breakpoint.ttl to "12h"; mixed lifetimes are billed using the response’s per-lifetime write counts. See prompt caching.

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

Built-in Web search costs $0.008 per search after the Codex 0.8× factor, in addition to token usage. Preview search on non-reasoning models costs $0.020 per search. Chat search models also incur a search fee. Page opens do not add a search-call fee. File search is disabled because the channel cannot verify ownership of vector stores. 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.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. Include conversation history directly in each request. All Codex models reject stored context references (previous_response_id, conversation, and prompt IDs), historical audio IDs, and remote file or image references.

After a disconnect, the proxy waits up to 15 seconds for final usage, within a total upstream deadline of 15 minutes. A stored receipt can be recovered later under the original operation ID. Only confirmed usage is charged.

Responses web search accepts 0–20 calls via max_tool_calls. Private tunnels, remote MCP tools, and custom voice IDs are unavailable through shared credentials. Supported audio models bill text and audio tokens separately.

A generation request is allowed while the API key and its funding source have a positive remaining balance. Output and tool limits are independent of that balance. Each completed request is billed from actual usage, so concurrent requests can take the balance below zero.

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-6.1-sol"
3
model_reasoning_effort = "high"
4
disable_response_storage = true
5
 
6
[model_providers.aiinide]
7
name = "AI in IDE"
8
base_url = "https://api.aiinide.com"
9
wire_api = "responses"
10
requires_openai_auth = true
11
 
12
[features]
13
web_search_request = true

Use gpt-6.1-sol in this configuration. gpt-5.5 has been retired. The CLI appends /responses to the base URL.

Existing Base URLs ending in /api/codex or /api/gemini continue to work with the same keys.

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://api.aiinide.com/responses

Example request:

1
export CODEX_API_KEY="YOUR_DASHBOARD_API_KEY"
2
 
3
curl --globoff --fail-with-body 'https://api.aiinide.com/responses' \
4
  -H "Authorization: Bearer $CODEX_API_KEY" \
5
  -H "Content-Type: application/json" \
6
  -d '{
7
    "model": "gpt-6.1-sol",
8
    "input": "Rewrite this sentence in plain English: The application facilitates the modification of account settings.",
9
    "reasoning": {"effort": "low"}, "max_output_tokens": 4096
10
  }'

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

1
curl --globoff --fail-with-body -N 'https://api.aiinide.com/responses' \
2
  -H "Authorization: Bearer $CODEX_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "model": "gpt-6.1-sol",
6
    "input": "Explain this JavaScript function in one sentence: function add(a, b) { return a + b; }",
7
    "reasoning": {"effort": "low"}, "max_output_tokens": 4096, "stream": true
8
  }'

These examples include all required input; they do not read a local repository. Check status: "completed" and output[].content[] for a non-streamed result, or the response.completed event when streaming. Inspect incomplete_details.reason if the output limit is reached; reasoning tokens count toward that limit. Verify usage in your usage history.

Chat Completions

OpenAI-compatible clients that use Chat Completions can call:

1
curl --globoff 'https://api.aiinide.com/chat/completions' \
2
  -H "Authorization: Bearer $CODEX_API_KEY" \
3
  -H "Content-Type: application/json" \
4
  -d '{
5
    "model": "gpt-6.1-sol",
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