# ahrigate API documentation

> Original AI model access, Claude and OpenAI API services, account packages and subscriptions, with support from our team in the European Union. API access uses Anthropic-compatible (/v1/messages) and OpenAI-compatible (/v1/chat/completions) endpoints; product orders use a separate storefront. Operated by a team in the European Union; company registration and jurisdiction details at https://ahrigate.com/legal.

Canonical HTML version: https://ahrigate.com/docs

## Quickstart

- Base URL: `https://api.ahrigate.com` (OpenAI-style clients use `https://api.ahrigate.com/v1`)
- Get an API key in the console: https://ahrigate.com/console/api-keys
- Authentication: `Authorization: Bearer sk-YOUR-AHRIGATE-KEY` (Anthropic-style clients may send the same key as `x-api-key: sk-YOUR-AHRIGATE-KEY`)

```bash
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":256,"messages":[{"role":"user","content":"Hello, ahrigate"}]}'
```

## Endpoints

| Endpoint | Method | Notes |
|---|---|---|
| `/v1/messages` | POST | Anthropic format: Claude Code and the Anthropic SDK |
| `/v1/chat/completions` | POST | OpenAI-compatible: chat, tool use, vision |
| `/v1/models` | GET | List models enabled on your key |

## OpenAI-compatible usage

OpenAI models are live: use the OpenAI-compatible endpoint with an OpenAI model id from the model list (served by the official group only; see pricing for each id). The same endpoint also serves Claude models. Example OpenAI model id: `gpt-6.1-sol`.

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.ahrigate.com/v1", api_key="sk-YOUR-AHRIGATE-KEY")
resp = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Hello, ahrigate"}],
)
print(resp.choices[0].message.content)
```

Environment variables: `export OPENAI_BASE_URL="https://api.ahrigate.com/v1"`, `export OPENAI_API_KEY="sk-YOUR-AHRIGATE-KEY"`

## Models

Available now (Claude):
- `claude-fable-5-1`: Claude Fable 5.1 (Newest)
- `claude-fable-5`: Claude Fable 5 (Premium)
- `claude-opus-5-5`: Claude Opus 5.5 (Flagship)
- `claude-opus-5`: Claude Opus 5
- `claude-opus-4-8`: Claude Opus 4.8 (Previous gen)
- `claude-opus-4-7`: Claude Opus 4.7 (Previous gen)
- `claude-sonnet-5-5`: Claude Sonnet 5.5 (Most popular)
- `claude-sonnet-5`: Claude Sonnet 5
- `claude-sonnet-4-6`: Claude Sonnet 4.6 (Previous gen)
- `claude-haiku-5-5`: Claude Haiku 5.5 (Fastest)
- `claude-haiku-4-5`: Claude Haiku 4.5 (Previous gen)

Available now (OpenAI, official group only; default `gpt-6.1-sol`):
- `gpt-6-astra`: GPT-6 Astra (Flagship)
- `gpt-6.1-sol`: GPT-6.1 Sol (Newest)
- `gpt-6-sol`: GPT-6 Sol
- `gpt-6-luna`: GPT-6 Luna (Efficient)
- `gpt-5.6-sol`: GPT-5.6 Sol (Previous gen)
- `gpt-5.6-terra`: GPT-5.6 Terra (Previous gen)
- `gpt-5.6-luna`: GPT-5.6 Luna (Previous gen)
- `gpt-5.5`: GPT-5.5 (Previous gen)
- `gpt-5.4`: GPT-5.4 (Previous gen)
- `gpt-5.4-mini`: GPT-5.4 mini (Previous gen)
- `gpt-5.4-nano`: GPT-5.4 nano (Previous gen)
- `gpt-5.3-codex`: GPT-5.3 Codex (Coding)

Prices for every model and group: https://ahrigate.com/pricing.md (markdown) or https://ahrigate.com/model-pricing (HTML).

## Pricing

All prices are USD per 1M tokens, shown as input / output. Ahrigate price = vendor (Anthropic or OpenAI) list price x the supply-group multiplier. The multiplier applies to every token type, including cache writes and reads. "n/a" means the group does not serve that model (OpenAI models are served by the official group only). For OpenAI models "n/a" in context / max output means OpenAI does not state the figure.

| Model | Provider | Context | Max output | List price (vendor) | Official (x0.85) | Bedrock (x0.65) | Subscription (x0.3) |
|---|---|---|---|---|---|---|---|
| `claude-fable-5-1` | Anthropic | 1M | 128K | $10 / $50 | $8.5 / $42.5 | $6.5 / $32.5 | $3 / $15 |
| `claude-fable-5` | Anthropic | 1M | 128K | $10 / $50 | $8.5 / $42.5 | $6.5 / $32.5 | $3 / $15 |
| `claude-opus-5-5` | Anthropic | 1M | 128K | $4 / $20 | $3.4 / $17 | $2.6 / $13 | $1.2 / $6 |
| `claude-opus-5` | Anthropic | 1M | 128K | $5 / $25 | $4.25 / $21.25 | $3.25 / $16.25 | $1.5 / $7.5 |
| `claude-opus-4-8` | Anthropic | 1M | 128K | $5 / $25 | $4.25 / $21.25 | $3.25 / $16.25 | $1.5 / $7.5 |
| `claude-opus-4-7` | Anthropic | 1M | 128K | $5 / $25 | $4.25 / $21.25 | $3.25 / $16.25 | $1.5 / $7.5 |
| `claude-sonnet-5-5` | Anthropic | 1M | 128K | $2 / $10 | $1.7 / $8.5 | $1.3 / $6.5 | $0.6 / $3 |
| `claude-sonnet-5` | Anthropic | 1M | 128K | $2 / $10 | $1.7 / $8.5 | $1.3 / $6.5 | $0.6 / $3 |
| `claude-sonnet-4-6` | Anthropic | 1M | 128K | $3 / $15 | $2.55 / $12.75 | $1.95 / $9.75 | $0.9 / $4.5 |
| `claude-haiku-5-5` (List price applies to prompts up to 100K tokens.) | Anthropic | 1M | 128K | $0.1 / $0.5 | $0.085 / $0.425 | $0.065 / $0.325 | $0.03 / $0.15 |
| `claude-haiku-4-5` | Anthropic | 200K | 64K | $1 / $5 | $0.85 / $4.25 | $0.65 / $3.25 | $0.3 / $1.5 |
| `gpt-6-astra` | OpenAI | 1.05M | 128K | $10 / $50 | $8.5 / $42.5 | n/a | n/a |
| `gpt-6.1-sol` | OpenAI | 1.05M | 128K | $2 / $10 | $1.7 / $8.5 | n/a | n/a |
| `gpt-6-sol` | OpenAI | n/a | n/a | $2 / $10 | $1.7 / $8.5 | n/a | n/a |
| `gpt-6-luna` | OpenAI | 1.05M | 128K | $0.1 / $0.5 | $0.085 / $0.425 | n/a | n/a |
| `gpt-5.6-sol` | OpenAI | n/a | n/a | $4 / $20 | $3.4 / $17 | n/a | n/a |
| `gpt-5.6-terra` | OpenAI | n/a | n/a | $2 / $12 | $1.7 / $10.2 | n/a | n/a |
| `gpt-5.6-luna` | OpenAI | n/a | n/a | $0.2 / $1.2 | $0.17 / $1.02 | n/a | n/a |
| `gpt-5.5` (List price applies to prompts under 272K tokens; longer prompts are billed at a higher long-context rate.) | OpenAI | n/a | n/a | $5 / $30 | $4.25 / $25.5 | n/a | n/a |
| `gpt-5.4` (List price applies to prompts under 272K tokens; longer prompts are billed at a higher long-context rate.) | OpenAI | n/a | n/a | $2.5 / $15 | $2.13 / $12.75 | n/a | n/a |
| `gpt-5.4-mini` | OpenAI | n/a | n/a | $0.75 / $4.5 | $0.637 / $3.83 | n/a | n/a |
| `gpt-5.4-nano` | OpenAI | n/a | n/a | $0.2 / $1.25 | $0.17 / $1.06 | n/a | n/a |
| `gpt-5.3-codex` | OpenAI | n/a | n/a | $1.75 / $14 | $1.49 / $11.9 | n/a | n/a |

Cache prices (cache write / cache read). Anthropic: 5-minute cache write. OpenAI charges no cache-write surcharge, so its cache write equals the input price:

| Model | Official cache write / read | Bedrock cache write / read | Subscription cache write / read |
|---|---|---|---|
| `claude-fable-5-1` | $10.63 / $0.212 | $8.13 / $0.163 | $3.75 / $0.075 |
| `claude-fable-5` | $10.63 / $0.85 | $8.13 / $0.65 | $3.75 / $0.3 |
| `claude-opus-5-5` | $4.25 / $0.17 | $3.25 / $0.13 | $1.5 / $0.06 |
| `claude-opus-5` | $5.31 / $0.425 | $4.06 / $0.325 | $1.88 / $0.15 |
| `claude-opus-4-8` | $5.31 / $0.425 | $4.06 / $0.325 | $1.88 / $0.15 |
| `claude-opus-4-7` | $5.31 / $0.425 | $4.06 / $0.325 | $1.88 / $0.15 |
| `claude-sonnet-5-5` | $2.13 / $0.085 | $1.63 / $0.065 | $0.75 / $0.03 |
| `claude-sonnet-5` | $2.13 / $0.17 | $1.63 / $0.13 | $0.75 / $0.06 |
| `claude-sonnet-4-6` | $3.19 / $0.255 | $2.44 / $0.195 | $1.13 / $0.09 |
| `claude-haiku-5-5` | $0.106 / $0.0085 | $0.0813 / $0.0065 | $0.0375 / $0.003 |
| `claude-haiku-4-5` | $1.06 / $0.085 | $0.813 / $0.065 | $0.375 / $0.03 |
| `gpt-6-astra` | $8.5 / $0.85 | n/a | n/a |
| `gpt-6.1-sol` | $1.7 / $0.085 | n/a | n/a |
| `gpt-6-sol` | $1.7 / $0.17 | n/a | n/a |
| `gpt-6-luna` | $0.085 / $0.0085 | n/a | n/a |
| `gpt-5.6-sol` | $3.4 / $0.34 | n/a | n/a |
| `gpt-5.6-terra` | $1.7 / $0.17 | n/a | n/a |
| `gpt-5.6-luna` | $0.17 / $0.017 | n/a | n/a |
| `gpt-5.5` | $4.25 / $0.425 | n/a | n/a |
| `gpt-5.4` | $2.13 / $0.212 | n/a | n/a |
| `gpt-5.4-mini` | $0.637 / $0.0638 | n/a | n/a |
| `gpt-5.4-nano` | $0.17 / $0.017 | n/a | n/a |
| `gpt-5.3-codex` | $1.49 / $0.149 | n/a | n/a |

Refunds: 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. Details: https://ahrigate.com/terms#refunds

Cheapest live option: `claude-haiku-5-5` in the `subscription` group ($0.03 / $0.15). Recommended default for Claude Code: `claude-opus-5-5`.
HTML version with the same numbers: https://ahrigate.com/model-pricing

## How to pay

- Currency: USD. 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.
- Requests return HTTP 402 when the balance is empty; top up at https://ahrigate.com/console/billing.
- Refunds: 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. Full policy: https://ahrigate.com/terms#refunds
- Invoices and billing questions: billing@ahrigate.com
- Top up here: https://ahrigate.com/console/billing

## Refunds and right of withdrawal

14-day refund for top-ups. If you buy API credit as a consumer, you may cancel the purchase within 14 days of paying, without giving a reason. We will refund the unused part of that top-up. Credit you have already used during those 14 days is not refunded, because the service has been provided at your request. To cancel, email billing@ahrigate.com with your account email and the top-up date (or use the Request refund button in Console > Billing). We confirm receipt and repay to your original payment method without undue delay and within 14 days of your request. Your bank may need a few extra days to show it. Cancelling does not affect past usage charges. At checkout we ask you to confirm that you want access to start immediately and that you understand how used credit is treated.

Business customers. If you buy for your business, the statutory consumer withdrawal right does not apply, but our policy still lets you request a refund of unused credit within 14 days of top-up. We decide business requests case by case.

Beyond 14 days. Unused balance is refundable on request if the service failed to work as described. Statutory rights under consumer law are unaffected.

Policy page: https://ahrigate.com/terms#refunds · contact: billing@ahrigate.com

## Claude Code setup

```bash
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
```

Or in `~/.claude/settings.json`:

```json
{"env":{"ANTHROPIC_BASE_URL":"https://api.ahrigate.com","ANTHROPIC_AUTH_TOKEN":"sk-YOUR-AHRIGATE-KEY","ANTHROPIC_API_KEY":"","ANTHROPIC_MODEL":"claude-opus-5-5"}}
```

- Use bare model ids exactly as listed (for example claude-opus-5-5). Do not append a [1m] suffix: 1M context is the default window and the gateway returns 502 for suffixed ids.
- Use one credential source: clear ANTHROPIC_API_KEY before setting ANTHROPIC_AUTH_TOKEN. Review existing Claude Code settings for environment overrides, and use /status to confirm the gateway connection.
- The subscription supply group only works from Claude Code clients and is best effort; it does not serve OpenAI models.

Setup guides for other tools: https://ahrigate.com/setup

## Streaming

Set `"stream": true` on either endpoint for server-sent events.

## Rate limits and output

Per-key defaults (checked 2026-10-25), higher on request: support@ahrigate.com. Per-key defaults, not guarantees; higher limits on request. Tokens/min = uncached input (new input + cache writes) + output; cache reads do not count. Max output is the synchronous Messages API cap.

| Group | Requests/min | Tokens/min | Concurrent | Notes |
|---|---|---|---|---|
| official | 60 | 400K | 8 | fair use |
| bedrock | 60 | 400K | 8 | fair use |
| subscription | 20 | 150K | 3 | Claude Code only, best effort, shared pool, may throttle |

On HTTP 429 honor the `retry-after` header if present, otherwise back off exponentially with jitter.

## Supply groups

Each API key is bound to one supply group.

- **Official** (`official`, x0.85): First-party vendor APIs (Anthropic, OpenAI). Most stable. Defaults, not guarantees. Higher limits on request after review.
- **Bedrock** (`bedrock`, x0.65): Routed through AWS Bedrock. Not supported on Bedrock: server tools (e.g. web search), Files API, Message Batches, MCP connector. Defaults, not guarantees. Higher limits on request after review.
- **Subscription** (`subscription`, x0.3): Claude Code clients only. Lowest price. Claude Code clients only; not for general API traffic. Best effort, shared pool: capacity depends on upstream session and weekly quotas, so requests may be throttled or delayed. No uptime or parity promise. Defaults, not guarantees.

## Errors

Error responses follow the OpenAI shape: `{ "error": { "message", "type", "code" } }`.

| Status | Cause | Fix |
|---|---|---|
| 400 | Malformed JSON or missing field | Read `error.message` |
| 401 | Missing or invalid API key | Send `Authorization: Bearer <key>` |
| 402 | Out of credit | Top up at https://ahrigate.com/console/billing |
| 403 | Key's supply group does not match the model | Use a key whose group serves that model |
| 429 | Rate limited | Honor `retry-after` if present, else back off exponentially |
| 5xx | Upstream provider issue | Retry with backoff; check https://ahrigate.com/status |

## Contact

Support support@ahrigate.com · billing billing@ahrigate.com · legal legal@ahrigate.com · privacy privacy@ahrigate.com
