Get to your first token.

Ahrigate is a Claude API gateway, built for Claude Code. Get a key, point your tool at api.ahrigate.com, send a request.

01

Quickstart

Claude Code first: set three environment variables and launch (base URL, auth token, model). Swap in your key from the console.

shell
unset ANTHROPIC_API_KEY   # Use only one credential source for this connection
export ANTHROPIC_BASE_URL="https://api.ahrigate.com"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR-AHRIGATE-KEY"
export ANTHROPIC_MODEL="claude-opus-5-5"   # key from Console -> API Keys
claude   # Claude Code now runs through Ahrigate

Or send a first request straight to the Anthropic-native endpoint:

shell
curl https://api.ahrigate.com/v1/messages \
  -H "Authorization: Bearer sk-YOUR-AHRIGATE-KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Ahrigate"}]
  }'
02

Authentication

All requests need a Bearer token. Keys look like sk-.... Create one in the console and pick its supply group.

shell
export AHRIGATE_API_KEY="sk-YOUR-AHRIGATE-KEY"

Store the key in an environment variable — never commit it to source control. Pass it as Authorization: Bearer $AHRIGATE_API_KEY on every request. Anthropic-style clients may send the same key as x-api-key.

Each key is bound to one supply group (official, bedrock or subscription); you choose it when you create the key. A model that is not available on the key's group returns 403.
03

First request

Ahrigate exposes both the OpenAI-compatible path (/v1/chat/completions) and the native Anthropic path (/v1/messages). Use whichever your SDK or tool speaks — the gateway handles both.

shell
curl https://api.ahrigate.com/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR-AHRIGATE-KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [{"role": "user", "content": "Hello, Ahrigate"}]
  }'

Endpoint summary

EndpointMethodNotes
/v1/chat/completionsPOSTOpenAI-compatible — chat, tool use, vision
/v1/messagesPOSTAnthropic format — Claude Code & Anthropic SDK
/v1/modelsGETList models enabled on your key

How to pay

Prepaid balance in USD, pay-as-you-go. Top up from the console: $10 minimum, $2000 maximum per top-up (presets $10, $25, $50, $100, $250). No monthly minimum. Checkout is hosted by Stripe; it offers the methods available for your region, for example card, Link, Alipay and WeChat Pay where eligible. Single-use redeem codes can also be applied to a balance in the console.

14-day refund: if you buy API credit as a consumer, you may cancel a top-up within 14 days of paying, without giving a reason, and we refund the unused part. Credit already used is not refunded. Refund policy

04

OpenAI-compatible

Drop-in replacement — change the base URL, keep your code. Any tool or SDK that speaks the OpenAI Chat Completions API works with Ahrigate without modification.

shell
# Before: api.openai.com/v1
# After: change the host only — everything else stays

curl https://api.ahrigate.com/v1/chat/completions \
  -H "Authorization: Bearer $AHRIGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5-5","messages":[{"role":"user","content":"Hello"}]}'
05

Models

Pass the model id in the model field. Browse the full model catalog for capabilities and pricing.

claude-fable-5-1Claude Fable 5.1 · 1M context · Newestlive
claude-fable-5Claude Fable 5 · 1M context · Premiumlive
claude-opus-5-5Claude Opus 5.5 · 1M context · Flagshiplive
claude-opus-5Claude Opus 5 · 1M contextlive
claude-opus-4-8Claude Opus 4.8 · 1M context · Previous genlive
claude-opus-4-7Claude Opus 4.7 · 1M context · Previous genlive
claude-sonnet-5-5Claude Sonnet 5.5 · 1M context · Most popularlive
claude-sonnet-5Claude Sonnet 5 · 1M contextlive
claude-sonnet-4-6Claude Sonnet 4.6 · 1M context · Previous genlive
claude-haiku-5-5Claude Haiku 5.5 · 1M context · Fastestlive
claude-haiku-4-5Claude Haiku 4.5 · 200K context · Previous genlive
gpt-6-astraGPT-6 Astra · OpenAI · 1.05M contextlive
gpt-6.1-solGPT-6.1 Sol · OpenAI · 1.05M context · default for OpenAI toolslive
gpt-6-solGPT-6 Sol · OpenAIlive
gpt-6-lunaGPT-6 Luna · OpenAI · 1.05M contextlive
gpt-5.6-solGPT-5.6 Sol · OpenAIlive
gpt-5.6-terraGPT-5.6 Terra · OpenAIlive
gpt-5.6-lunaGPT-5.6 Luna · OpenAIlive
gpt-5.5GPT-5.5 · OpenAIlive
gpt-5.4GPT-5.4 · OpenAIlive
gpt-5.4-miniGPT-5.4 mini · OpenAIlive
gpt-5.4-nanoGPT-5.4 nano · OpenAIlive
gpt-5.3-codexGPT-5.3 Codex · OpenAIlive
06

Streaming

Set "stream": true for server-sent events. Tokens arrive as they are generated instead of after the full response.

shell
curl https://api.ahrigate.com/v1/chat/completions \
  -H "Authorization: Bearer $AHRIGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [{"role": "user", "content": "Write a haiku"}],
    "stream": true
  }'
07

1M context (Claude)

Ahrigate passes through the 1 million token context of Claude models that have it (not Haiku 4.5, which is 200K). Use a bare model id (no [1m] suffix). No beta header is needed — 1M is the default window on current models.

Claude Code — env vars

shell
# Claude Code — 1M context via Ahrigate (bare model id required; no [1m] suffix)
unset ANTHROPIC_API_KEY   # Use only one credential source for this connection
export ANTHROPIC_BASE_URL="https://api.ahrigate.com"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR-AHRIGATE-KEY"
export ANTHROPIC_MODEL="claude-opus-5-5"

claude   # launch Claude Code — now routed through Ahrigate

Alternative: ~/.claude/settings.json

settings.json
// ~/.claude/settings.json  (alternative to env vars)
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.ahrigate.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR-AHRIGATE-KEY",
    "ANTHROPIC_MODEL": "claude-opus-5-5",
    "ANTHROPIC_API_KEY": ""
  }
}
Important: use one credential source — clear any stale ANTHROPIC_API_KEY first (unset ANTHROPIC_API_KEY) so it cannot take precedence over ANTHROPIC_AUTH_TOKEN, then run /status to confirm the gateway.
08

Rate limits & output

Limits apply per API key and depend on its supply group. These are defaults, not guarantees; need more? Email support@ahrigate.com.

GroupRequests/minTokens/minConcurrent
official60400K8
bedrock60400K8
subscription (best effort)20150K3
  • Tokens per minute count uncached input (new input plus cache writes) and output. Cache reads do not count.
  • When a limit is hit you get HTTP 429. Honor the retry-after header if present, otherwise back off exponentially with jitter (for example 1s, 2s, 4s, up to about 30s). Official SDKs do this automatically.
  • Context window is 1M tokens on current Claude models and 200K on Claude Haiku 4.5. Max output is 128K tokens per request (64K on Haiku 4.5). See the model catalog for each model; OpenAI figures are shown only where OpenAI states them.
09

Supply groups

Each API key is bound to one supply group, which decides where requests are served and what they cost.

  • Official: First-party vendor APIs (Anthropic, OpenAI). Most stable. 60 req/min · 400K tok/min · 8 concurrent; defaults, more on request.
  • Bedrock: Routed through AWS Bedrock. 60 req/min · 400K tok/min · 8 concurrent; defaults, more on request.
  • Subscription: Claude Code clients only. Lowest price. 20 req/min · 150K tok/min · 3 concurrent (best effort, shared pool); defaults, more on request.
10

Errors

Error responses follow OpenAI shape: { error: { message, type, code } }

StatusCauseFix
401Missing or invalid API keyCheck your Authorization header — must be Bearer sk-...
402Out of creditTop up at /console/billing
403Model not available on this key's supply groupPick a model listed for the key's group, or create a key on another group
429Rate limitedHonor retry-after if present, else back off exponentially. See Rate limits & output
400Bad request — malformed JSON or missing fieldCheck the error.message field for specifics
5xxUpstream issueRetry with backoff — check ahrigate.com/status

Ready to start?

Create an API key in the console, pick a supply group, and make your first request.

Create an API key