BrainstormRouter is a personal research project by Justin Jilg. It is not a commercial product, has no SLA and is not intended for production use.

CrewAI

Route CrewAI agent teams through BrainstormRouter.

Setup

pip install crewai openai brainstormrouter

Configuration

CrewAI uses the OpenAI SDK under the hood. Point it at BrainstormRouter:

import os

os.environ["OPENAI_API_BASE"] = "https://api.brainstormrouter.com/v1"
os.environ["OPENAI_API_KEY"] = "br_live_..."

Basic crew

from crewai import Agent, Task, Crew

researcher = Agent(
    role="Research Analyst",
    goal="Find key market trends",
    backstory="Expert at analyzing market data",
    llm="anthropic/claude-sonnet-5",
)

writer = Agent(
    role="Content Writer",
    goal="Write compelling reports",
    backstory="Expert technical writer",
    llm="openai/gpt-4o",
)

task = Task(
    description="Research AI gateway market and write a 500-word summary",
    agent=researcher,
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[task],
)

result = crew.kickoff()

Cost optimization

Use BrainstormRouter presets to optimize cost across agents:

# Expensive tasks get the quality model
researcher = Agent(
    role="Research Analyst",
    llm="@preset/high-quality",  # anthropic/claude-sonnet-5, quality strategy
)

# Simple tasks get the cheap model
formatter = Agent(
    role="Formatter",
    llm="@preset/fast-cheap",  # openai/gpt-4o-mini, price strategy
)

With memory

Pre-load project context so all agents share knowledge:

from brainstormrouter import BrainstormRouter  # Python SDK

# Or use curl/requests:
import requests

requests.post(
    "https://api.brainstormrouter.com/v1/memory/entries",
    headers={"Authorization": "Bearer br_live_..."},
    json={"fact": "Company sells Widget Pro to enterprises", "block": "project"},
)

Benefits over direct API calls

  • Automatic fallbacks: If Claude rate-limits, GPT-4o takes over seamlessly
  • Cost tracking: See per-agent, per-task cost in the dashboard
  • Memory sharing: All agents access the same persistent memory
  • Guardrails: Content safety applied to all agent outputs