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

OpenRouterBrainstormRouterNotes
openrouter.ai/api/v1api.brainstormrouter.com/v1Same API shape
OPENROUTER_API_KEYbr_live_...Standard Bearer auth
openai/gpt-4o model namesopenai/gpt-4o — same formatProvider/model convention matches
Credits systemBYOK — you pay providers directlyNo markup on token costs
X-Title headerTenant name (auto from API key)Per-key isolation
Route prefixes (:free, etc.)Variants (:floor, :fast, :best, :smart)Similar concept, more options
No routing intelligenceThompson sampling + auto modeBR learns optimal models
No budget enforcementPer-key daily budgetsHard caps that block requests
Activity feedDashboard + X-BR-* headersReal-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

  1. Sign up at brainstormrouter.com/dashboard
  2. Add your provider keys in Configure → Providers
  3. Create a gateway API key in Configure → API Keys (set a daily budget if desired)
  4. Find-and-replace your base URL and API key
  5. (Optional) Change model to "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"])