NEW27 models · 8 providers · one endpoint

One API.
Every AI Model.
Total Control.

Access the world's leading AI models through a single API. Smart routing, transparent pricing, and unified billing for developers.

No credit card required Pay only for tokens you use Streaming & tool calling
router.hanlinrouter.site
POST /v1
live catalog
prompt
model: auto~38 in / 420 out
candidatesest. cost
gemini-3-proSELECTED$6139.20000
claude-sonnet-4-5$7696.80000
claude-opus-4-5$12828.00000
x-hanlin-model: gemini-3-pro
x-hanlin-provider: Google
x-hanlin-cost-usd: 6139.200000
x-hanlin-fallback: enabled (2 retries)

Simulated with live catalog prices · sign in to run real requests

Automatic fallback across providers99.99% routing SLA
Works withOpenAI APIAnthropic MessagesGemini APIStreaming SSETool callingPrompt caching

One key · every provider

OpenAI
Anthropic
Google
Qwen
DeepSeek
Z.ai (GLM)
xAI
Moonshot (Kimi)
OpenAI
Anthropic
Google
Qwen
DeepSeek
Z.ai (GLM)
xAI
Moonshot (Kimi)
Built for production

The router layer your AI stack was missing

Everything between your application and ten model providers: routing, retries, metering, billing and observability.

Smart routing

One model name — `auto` — picks the best model for cost, latency or quality on every request.

GPT-5.1
Claude 4.5
Gemini 3
DeepSeek

Automatic fallback

Provider down or rate-limited? The router retries on a second provider before the request fails.

Unified billing

One balance for GPT, Claude, Gemini, DeepSeek and more. No more five dashboards and prepaid islands.

Prompt caching

Cached input tokens are billed at up to 90% less and reported separately in your usage.

Usage analytics

Per-key, per-model and per-day cost breakdowns with token-level request logs.

Multiple protocols

OpenAI chat completions, Anthropic messages and Gemini generateContent — same key, same balance.

Secure API keys

Keys are hashed at rest, scoped per model, per IP and per budget — revocable instantly.

Cost optimization

Set daily and monthly spend caps so a runaway agent can never surprise your invoice.

Live pricing

Official provider list prices, per 1M tokens in USD. Billed per request with no minimums.

Full catalog
ModelInput / 1MOutput / 1M
GPT-5.1
OpenAI · gpt-5.1
$1.5$12
Claude Opus 4.5
Anthropic · claude-opus-4-5
$6$30
GPT-5.1 Codex
OpenAI · gpt-5.1-codex
$1.5$12
Claude Sonnet 4.5
Anthropic · claude-sonnet-4-5
$3.6$18
Gemini 3 Pro
Google · gemini-3-pro
$2.4$14.4
DeepSeek V3.2
DeepSeek · deepseek-chat
$0.336$0.504
GPT-5.1 mini
OpenAI · gpt-5.1-mini
$0.3$2.4
Showing 7 of 27 models Smart routing & automatic fallback included
Prices per 1M tokens, USD. Cache-read prices shown where the provider supports prompt caching.markup: 20% · charged per request, to the micro-dollar
Drop-in compatible

Three protocols. One gateway.

Point any existing SDK at HanlinRouter. Your OpenAI, Anthropic and Gemini integrations keep working — only the base URL and key change.

OpenAI-compatible

https://hanlinrouter.site/v1

live

Anthropic Messages

https://hanlinrouter.site/api

live

Gemini API

https://hanlinrouter.site/v1beta

live
openai_sdk.py
from openai import OpenAI

client = OpenAI(
    api_key=0,
    base_url=1,
)

response = client.chat.completions.create(
    model=2,  class="tok-com"># or gpt-5.1, claude-sonnet-4-5, gemini-2.5-flash
    messages=[{3: 4, 5: 6}],
    stream=True,
)

for chunk in response:
    print(chunk.choices[0].delta.content or 7, end=8)

27+

Models available

8

Providers aggregated

< 8ms

Routing overhead

99.99%

Gateway uptime

Works with your agents

Drop-in for 10+ coding agents and clients

If it speaks OpenAI, Anthropic or Gemini, it speaks HanlinRouter. Swap the base URL and keep your workflow.

Cl

Claude Code

Anthropic's terminal agent

ANTHROPIC_BASE_URL="https://hanlinrouter.site/api"

Op

OpenAI Codex

Codex CLI and cloud tasks

base_url = "https://hanlinrouter.site/v1"

Cu

Cursor

Override OpenAI base URL

OPENAI_BASE_URL="https://hanlinrouter.site/v1"

Cl

Cline

VS Code autonomous agent

API Provider → OpenAI Compatible

Co

Continue

Open-source IDE assistant

apiBase: "https://hanlinrouter.site/v1"

Op

OpenClaw

Self-hosted agent runtime

OPENAI_BASE_URL="https://hanlinrouter.site/v1"

Full setup guides in documentation.

FAQ

Questions, answered

Everything about routing, billing, limits and data handling.

HanlinRouter is an AI API gateway. You get one API key and one balance, and can call GPT-5.1, Claude Opus 4.5, Gemini 3 Pro, DeepSeek, Qwen, GLM, Kimi, Grok and more through the same OpenAI, Anthropic or Gemini compatible endpoints. The router handles provider selection, retries, token metering and billing.

Still curious? Talk to us or read the documentation.

Setup takes about 60 seconds

Ship your AI feature on one key.

Create an account, generate a key, and point your SDK at HanlinRouter. Your first request is a base-URL change away.

Keys hashed at rest Streaming from day one Full request logs