AI Model Router API

Route prompts to the right LLM — cheapest model that fits your task. GPT-4o · Claude 3 · Gemini 1.5/2.0. No external API calls.

The Problem

Every LLM call uses the same model even when a cheap model would do. A classification task costs 100x more than necessary when sent to GPT-4. This API picks the right model automatically.

GET /route

Describe your task. Get back the optimal model, estimated cost, and reasoning.

GET /compare

Side-by-side cost breakdown across all 9 models for your token count.

GET /models

Full catalog: pricing, context windows, strengths per model.

POST /mcp

MCP-compatible — plug into any agent that supports JSON-RPC 2.0 tools.

Route a coding task to the cheapest capable model:

curl "https://api.lazy-mac.com/ai-model-router/route?prompt=write+a+quicksort+in+python&prefer_tier=economy" # Response: { "selected_model": "gemini-1.5-flash", "provider": "google", "tier": "economy", "task_classification": "code", "estimated_cost_usd": 0.00003, "reasoning": "Task classified as \"code\". gemini-1.5-flash has native strength in code tasks. Economy-tier model balances quality and cost." }

Compare all models for a 2000-token analysis job:

curl "https://api.lazy-mac.com/ai-model-router/compare?task_type=analysis&input_tokens=2000"

Free

$0/mo
  • 100 requests/day
  • All routing endpoints
  • Full model catalog
  • MCP support

Pro

$29/mo
  • Unlimited requests
  • Priority routing
  • Batch compare endpoint
  • Priority support
Get API Key — $29/mo