Migrating from OpenRouter
Switch from OpenRouter to BrainstormRouter — what changes and what you gain.
Overview
OpenRouter and BrainstormRouter both offer multi-model access through an OpenAI-compatible API. BrainstormRouter adds intelligent routing, budget enforcement, quality scoring, and a full audit trail. This guide covers the migration.
Concept mapping
| OpenRouter | BrainstormRouter | Notes |
|---|---|---|
openrouter.ai/api/v1 | api.brainstormrouter.com/v1 | Same API shape |
OPENROUTER_API_KEY | br_live_... | Standard Bearer auth |
openai/gpt-4o model names | openai/gpt-4o — same format | Provider/model convention matches |
| Credits system | BYOK — you pay providers directly | No markup on token costs |
X-Title header | Tenant name (auto from API key) | Per-key isolation |
Route prefixes (:free, etc.) | Variants (:floor, :fast, :best, :smart) | Similar concept, more options |
| No routing intelligence | Capability-matched auto mode | Tier floor + learned quality/cost |
| No budget enforcement | Per-key daily budgets | Hard caps that block requests |
| Activity feed | Dashboard + X-BR-* headers | Real-time per-request metrics |
What changes
1. Base URL + Auth
- base_url = "https://openrouter.ai/api/v1"
- api_key = "sk-or-v1-..."
+ base_url = "https://api.brainstormrouter.com/v1"
+ api_key = "br_live_..."
2. Provider keys
OpenRouter manages provider accounts for you (with a margin). BrainstormRouter is BYOK — you add your own provider keys once in the dashboard, and the gateway uses them directly. You pay providers at their published rates, no markup.
3. Model variants
- model = "openai/gpt-4o:free"
+ model = "openai/gpt-4o:floor" # cheapest endpoint
+ model = "openai/gpt-4o:fast" # lowest latency
+ model = "openai/gpt-4o:best" # highest quality
+ model = "openai/gpt-4o:smart" # capability-matched routing
+ model = "auto" # let BR pick everything
What BrainstormRouter adds
- Intelligent routing —
autois capability-matched: a required-tier floor plus learned quality vs. cost per request (Thompson sampling powers the model leaderboard, not the per-request pick) - Budget enforcement — Per-key daily spend caps. When the budget hits zero, requests are blocked (not just warned)
- Circuit breakers — Automatic failover when a provider has errors, without routing all traffic away permanently
- Quality scoring — Per-model validity scoring (JSON accuracy, schema compliance, tool-call success)
- Governance headers — Every response includes
X-BR-Routed-Model,X-BR-Actual-Cost,X-BR-Route-Reason - Multi-tenant isolation — Each API key is scoped to a tenant with separate budgets, rate limits, and provider keys
Migration steps
- Sign up at brainstormrouter.com/dashboard
- Add your provider keys in Configure → Providers
- Create a gateway API key in Configure → API Keys (set a daily budget if desired)
- Find-and-replace your base URL and API key
- (Optional) Change
modelto"auto"to enable intelligent routing
SDK example
from openai import OpenAI
# Before (OpenRouter)
# client = OpenAI(
# base_url="https://openrouter.ai/api/v1",
# api_key="sk-or-v1-...",
# )
# After (BrainstormRouter)
client = OpenAI(
base_url="https://api.brainstormrouter.com/v1",
api_key="br_live_...",
)
# Inspect the routing decision — headers live on the raw response,
# not on the parsed completion object
raw = client.chat.completions.with_raw_response.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
)
print(raw.headers["X-BR-Routed-Model"])
print(raw.headers["X-BR-Actual-Cost"])
response = raw.parse() # the usual completion object
print(response.choices[0].message.content)