# AI API Cost Estimator An unauthenticated API that estimates LLM inference cost for a described workload, over live pricing for 300+ models (sourced from OpenRouter, refreshed hourly). No API key required. ## Endpoints GET /api/models List the model catalog with current per-1M and per-token prices. Optional: ?q= to filter (e.g. ?q=claude). GET /api/estimate Estimate cost via query params. Repeat ?model= to compare several. Params: model model id or substring (repeatable, or comma-separated) tokens_in input tokens per call (default 1500) tokens_out output tokens per call (default 400) calls number of calls per period (default 1000) period day | week | month (default day) mode live | batch (default live) batch_discount multiplier for batch mode (default 0.5) cache_hit_ratio 0..1 fraction of cached input (default 0) reasoning_tokens reasoning tokens per call (default 0) Example: /api/estimate?model=anthropic/claude-sonnet-5&model=openai/gpt-5.4&tokens_in=1500&tokens_out=400&calls=50000&period=day POST /api/estimate Same, via JSON body: { "models": ["..."], "tokens_in": 1500, ... } ## Response shape { "workload": { ...echoed inputs... }, "pricing_fetched_at": "ISO timestamp", "cheapest": "model-id", "max_monthly_savings": 8100.0, "summary": "plain-English one-liner you can relay to a user", "results": [ { "modelId", "modelName", "breakdown", "projected": {day,week,month,year}, "notes" } ] } All costs are USD. See /api/openapi.json for the full schema.