Quick tests

Validate the gateway first

Start with curl on both OpenAI-compatible paths. Once either returns cleanly, keep the same gateway origin and use the URL shape each client expects.

Chat completions

Smoke test `/v1/chat/completions`

Use the smallest possible messages payload first. A successful response confirms the key, URL, and model are aligned.

Quick copy
curl https://cheaprouter.uk/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      {
        "role": "user",
        "content": "Write a one-line hello from cheapRouter."
      }
    ]
  }'

Responses

Smoke test `/v1/responses`

Use this when a client expects OpenAI’s newer response-shaped protocol on the wire.

Quick copy
curl https://cheaprouter.uk/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "model": "gpt-5.4",
    "stream": true,
    "input": "Write a one-line hello from cheapRouter."
  }'

Local clients

Point coding tools at cheapRouter

Keep auth local, keep the gateway origin consistent, and only change the base URL format or provider metadata each client needs.

Codex

Update `~/.codex/config.toml`

Set cheapRouter as the provider and keep the wire API on responses so Codex uses the expected protocol.

1. Provider config

Quick copy
model_provider = "cheapRouter"
model = "gpt-5.4"

[model_providers.cheapRouter]
base_url = "https://cheaprouter.uk/v1"
name = "cheapRouter"
wire_api = "responses"

Codex auth

Store the key in `~/.codex/auth.json`

Keep the token separate from the TOML config so the provider block stays reusable across machines.

2. Local auth

Quick copy
{
  "OPENAI_API_KEY": "your API key"
}

Claude Code

Update `~/.claude/settings.json`

Set the gateway origin and auth token in env so Claude Code routes through cheapRouter without changing the slot layout.

Quick copy
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://cheaprouter.uk",
    "ANTHROPIC_AUTH_TOKEN": "your API key",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.4",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.3-codex",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.4-mini",
    "MAX_THINKING_TOKENS": "30000",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "300000",
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

OpenClaw

Update `~/.openclaw/openclaw.json`

Define a `cheaprouter` provider and set `agents.defaults.model.primary` to `cheaprouter/gpt-5.4` so OpenClaw uses the gateway without relying on deprecated unprefixed model resolution.

~/.openclaw/openclaw.json

Quick copy
{
  "models": {
    "mode": "merge",
    "providers": {
      "your-provider-name": {
        "baseUrl": "https://cheaprouter.uk/v1",
        "apiKey": "your-api-key-here",
        "api": "openai-completions",
        "models": [
          {
            "id": "gpt-5.4",
            "name": "gpt-5.4",
            "reasoning": true,
            "input": ["text", "image"],
            "cost": {
              "input": 0.01,
              "output": 0.03,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 32000,
            "maxTokens": 32000
          }
        ]
      }
    }
  }
}

Defaults

Keep first-run setup predictable

  • Replace placeholder API keys before any live request.
  • The gateway accepts `Authorization: Bearer <your-api-key>` and `X-Api-Key: <your-api-key>`.
  • Use `https://cheaprouter.uk` or `https://cheaprouter.uk/v1` based on the client.
  • Smoke test with `gpt-5.4` first, then switch to your target model.