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 | Thompson sampling + auto mode | BR learns optimal models |
| 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" # Thompson sampling
+ model = "auto" # let BR pick everything
What BrainstormRouter adds
- Intelligent routing — Thompson sampling learns which models produce best results for your specific workload
- 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-Selected-Model,X-BR-Actual-Cost,X-BR-Efficiency - 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_...",
)
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
)
# Inspect the routing decision
print(response.headers["X-BR-Selected-Model"])
print(response.headers["X-BR-Actual-Cost"])