Documentation

Build with 1Router

A single, OpenAI-compatible API for every model. Drop-in replacement — just change the base URL.

Quickstart

1Router is fully OpenAI-compatible. Point your existing SDK at our API and it just works.

cURL
curl https://api.1router.com/v1/chat/completions \
  -H "Authorization: Bearer $ROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Python (openai SDK)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.1router.com/v1",
    api_key=os.environ["ROUTER_API_KEY"]
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
JavaScript / TypeScript
import OpenAI from "openai"

const client = new OpenAI({
  baseURL: "https://api.1router.com/v1",
  apiKey: process.env.ROUTER_API_KEY,
})

const response = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
})
console.log(response.choices[0].message.content)

Key Concepts

Model Routing

Available

The current alpha resolves an explicit provider/model-name from the shared catalog and routes it to the configured provider. Automatic cost/latency routing is planned.

Fallbacks

Roadmap

Provider pools, health-aware retries, and fallback models are planned. Today, each request is sent to the provider selected by its catalog model ID.

Rate Limiting & Usage

Roadmap

Per-key limits, quotas, spend controls, and a usage ledger are planned for the next control-plane phase. The current API uses one server-level master key.

Ready to start building?

Configure the self-hosted alpha and make your first call in minutes.