I built CostRouter because I noticed 70-80% of our AI API calls didn't need GPT-4o/5. Simple text extraction, basic Q&A, formatting — all going to the most expensive model.
CostRouter is an API gateway that scores each request's complexity (0-100) and routes it to the cheapest model that can handle it:
- Simple queries → Llama 4 Scout ($0.0001/1K tokens) - Medium → Gemini 3 Flash ($0.0005/1K tokens) - Complex reasoning → stays on GPT-5.2 or Claude Opus
Integration is one line — just change your base_url:
client = OpenAI(
api_key="crx_live_...",
base_url="https://cost-router-alex10020s-projects.vercel.app/api/v1"
)
Pricing: we charge 10% of what we save you. If we save you $0, you pay $0.In a 100K request/month test: - Before: $3,127/mo (all GPT-5.2) - After: $1,245/mo - Net savings after our fee: $1,694/mo
Tech stack: Next.js, Supabase, Vercel. The routing engine scores prompt complexity based on length, keyword analysis, and structural patterns, then maps to the cheapest model above the quality threshold.
Would love feedback on the routing approach and pricing model.
https://cost-router-alex10020s-projects.vercel.app