Text model integration guide

Pick a protocol first, then copy the full config for your client.

You don't need to understand every API. Pick Responses, Messages, or Chat — the protocols AIReiter currently supports — then copy a config verified against official docs or this project's code.

Price comparisonGPT-5.6 models are priced at 50% of official API rates

Official API price vs AIReiter price

All prices are per 1M tokens. AIReiter is currently set to half of the official GPT-5.6 rate, including normal input, output, cached input, and cache writes.

50%

AIReiter price is half of the official API price across both context tiers and all cache billing buckets.

ModelContext tierInputOutputCache readCache write
GPT-5.6 LunaContext < 272K
Official$1.00AIReiter$0.50
Official$6.00AIReiter$3.00
Official$0.10AIReiter$0.05
Official$1.25AIReiter$0.625
GPT-5.6 LunaContext >= 272K
Official$2.00AIReiter$1.00
Official$9.00AIReiter$4.50
Official$0.20AIReiter$0.10
Official$2.50AIReiter$1.25
GPT-5.6 TerraContext < 272K
Official$2.50AIReiter$1.25
Official$15.00AIReiter$7.50
Official$0.25AIReiter$0.125
Official$3.125AIReiter$1.5625
GPT-5.6 TerraContext >= 272K
Official$5.00AIReiter$2.50
Official$22.50AIReiter$11.25
Official$0.50AIReiter$0.25
Official$6.25AIReiter$3.125
GPT-5.6 SolContext < 272K
Official$5.00AIReiter$2.50
Official$30.00AIReiter$15.00
Official$0.50AIReiter$0.25
Official$6.25AIReiter$3.125
GPT-5.6 SolContext >= 272K
Official$10.00AIReiter$5.00
Official$45.00AIReiter$22.50
Official$1.00AIReiter$0.50
Official$12.50AIReiter$6.25

How billing matches the upstream

The tier is chosen by full input context length. Cached tokens use cache read or cache write prices when the upstream reports cached_tokens or cache_write_tokens; otherwise normal input and output prices apply.

Responses protocol/api/v1/responses

Codex CLI

Tools like Codex CLI work best over Responses. The key points: base_url stops at /api/v1 and wire_api is set to responses, with the key read from the env var pointed to by env_key.

OpenAI officialView source

The model_providers / base_url / wire_api / env_key fields come from Codex's official Advanced Configuration docs; that env_key must point to an env var and that requires_openai_auth disables env_key are also official statements. Note wire_api only accepts responses since Codex 0.59.

Client Base URL

https://aireiter.com/api/v1

Client-appended path

/responses

Final request URL

https://aireiter.com/api/v1/responses

Example model

gpt-5.6-luna

1

1. Write config.toml

File location: ~/.codex/config.toml. base_url must stop at /api/v1; Codex calls /responses per wire_api = "responses". env_key points to an environment variable name — never put the real key in the TOML, and do not add requires_openai_auth = true: with it Codex ignores env_key and demands official OpenAI login instead.

Copy-ready
model_provider = "aireiter"
model = "gpt-5.6-luna"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.aireiter]
name = "AIReiter"
base_url = "https://aireiter.com/api/v1"
wire_api = "responses"
env_key = "AIREITER_API_KEY"
2

2. Export the API key env var

Codex reads the key from the env var named by env_key at startup. Write it into your shell profile so it persists; never commit the real key to a repository.

Copy-ready
echo 'export AIREITER_API_KEY="sk-replace-with-your-key"' >> ~/.zshrc
source ~/.zshrc
3

3. macOS / Linux one-shot setup

Both steps merged into one block you can paste and run. If you already have a config.toml, merge by hand to avoid overwriting other providers.

Copy-ready
mkdir -p "$HOME/.codex"

cat > "$HOME/.codex/config.toml" <<EOF
model_provider = "aireiter"
model = "gpt-5.6-luna"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.aireiter]
name = "AIReiter"
base_url = "https://aireiter.com/api/v1"
wire_api = "responses"
env_key = "AIREITER_API_KEY"
EOF

echo 'export AIREITER_API_KEY="sk-replace-with-your-key"' >> ~/.zshrc
source ~/.zshrc
4

4. Windows PowerShell one-shot setup

Windows users copy this block. setx writes a user-level env var; open a new terminal window for it to take effect.

Copy-ready
$configDir = "$env:USERPROFILE\.codex"
New-Item -Path $configDir -ItemType Directory -Force | Out-Null

@"
model_provider = "aireiter"
model = "gpt-5.6-luna"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.aireiter]
name = "AIReiter"
base_url = "https://aireiter.com/api/v1"
wire_api = "responses"
env_key = "AIREITER_API_KEY"
"@ | Set-Content -Path "$configDir\config.toml"

setx AIREITER_API_KEY "sk-replace-with-your-key"
5

5. Connectivity self-check

Request the model list first. Launch Codex only after you get a JSON list back — troubleshooting gets much easier.

Copy-ready
curl -sS -i "https://aireiter.com/api/v1/models" \
  -H "Authorization: Bearer $AIREITER_API_KEY" | head -n 20
6

6. Launch Codex

Launch after entering your project directory. Streaming output means the Responses integration works.

Copy-ready
cd ~/your-project
codex
7

Status code cheat sheet

When users report errors, check the status code first, then base_url and the key.

Copy-ready
HTTP 200  Config is correct, start your client
HTTP 401  Key is wrong or missing, re-copy your API key
HTTP 403  Key has no access to this model, check account or model permission
HTTP 404  Wrong URL, first check whether base_url has an extra or missing /api/v1
HTML returned  Request hit the website frontend, base_url is wrong
HTTP 502/504  Gateway or upstream hiccup, retry later
Third-party client quick referenceAll config fields come from each client's official docs

Which endpoint for CC Switch or OpenClaw?

They are clients that carry a protocol, not protocols themselves: give Claude Code-style tools the Anthropic-style address, and OpenAI-compatible tools /api/v1. Full step-by-step guides live under the matching protocol above.

CC Switch

In the Claude Code tab set the provider base URL to https://aireiter.com/api — guide under "Messages protocol → CC Switch (GUI)". In the Codex tab use https://aireiter.com/api/v1 — guide under "Responses protocol → CC Switch (GUI)".

OpenClaw

With api: "openai-completions" set baseUrl to https://aireiter.com/api/v1; with api: "anthropic-messages" use https://aireiter.com/api. Step-by-step guide under "Chat protocol → OpenClaw".

Industry alignmentHow OpenAI-compatible gateways write baseURL

Don't mix up the base URL and the final URL.

Text-model gateways like OpenRouter, Groq, and Together all have the SDK baseURL/base_url stop at /v1, with the SDK method appending /chat/completions. This page splits them the same way: client base URL, client-appended path, and final request URL are shown separately.

Is there a count_tokens?

Yes, at /api/v1/messages/count_tokens. It only does Anthropic token counting — it is not a generation endpoint.

Are the sources reliable?

Copy-ready configs only include what official docs, the OpenAI/Anthropic protocols, or this project's code can verify; third-party clients get compatibility notes only.

Which should beginners pick?

Codex → Responses; Claude Code → Messages; OpenAI SDK and generic OpenAI-compatible clients → Chat; if you'd rather not edit config files, use the CC Switch GUI.