RouterHub API
Unified access to Claude, Gemini, and GPT models through OpenAI-compatible and Anthropic-compatible endpoints.
https://api.routerhub.ai
Quick Start
Make your first API call in seconds. Replace YOUR_API_KEY with your RouterHub API key.
curl https://api.routerhub.ai/v1/chat/completions \
-H "Authorization: Bearer $ROUTERHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4",
"messages": [
{"role": "user", "content": "Hello, what can you do?"}
]
}'import requests
response = requests.post(
"https://api.routerhub.ai/v1/chat/completions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "anthropic/claude-sonnet-4",
"messages": [
{"role": "user", "content": "Hello, what can you do?"}
],
},
)
print(response.json()["choices"][0]["message"]["content"])from openai import OpenAI
client = OpenAI(
base_url="https://api.routerhub.ai/v1",
api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4",
messages=[
{"role": "user", "content": "Hello, what can you do?"}
],
)
print(response.choices[0].message.content)Two APIs
RouterHub exposes two fully compatible API surfaces. Use whichever fits your existing workflow.
OpenAI-Compatible
POST /v1/chat/completions
Works with any OpenAI SDK. Drop in your RouterHub base URL and API key to route requests to Claude, Gemini, or GPT models without changing your code.
View documentation →Anthropic-Compatible
POST /v1/messages
Works with the Anthropic SDK. Use the native Anthropic Messages API format with full support for thinking, tool use, and streaming.
View documentation →Features
Streaming
Real-time server-sent events for low-latency token-by-token output across all providers.
Learn more →Tool Calling
Define functions and let models invoke them with structured arguments in a single request flow.
Learn more →Structured Output
Constrain model responses to a JSON schema for reliable, parseable output every time.
Learn more →Reasoning
Enable extended thinking to let models work through complex problems step by step before responding.
Learn more →Available Models
RouterHub provides access to leading model families from Anthropic, Google, and OpenAI.
Claude
7 models
Claude Opus 4, Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Haiku 4.5, Claude 3.5 Sonnet v2, Claude 3.5 Haiku
Gemini
5 models
Gemini 3 Pro Preview, Gemini 3 Flash Preview, Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash Lite
GPT
10 models
GPT-5, GPT-5.2 Chat, GPT-5.2, GPT-5.2 Codex, GPT-5.1, GPT-5.1 Codex, GPT-5.1 Codex Mini, GPT-4.1, GPT-4o, o1