# modelprices.xyz — LLM market data for agents Pay-per-call via x402 (USDC on Base, eip155:8453). No accounts, no API keys. All endpoints are GET. ## Pick the right endpoint (cheapest first) - Need ONE model's price → GET /llm/price/{model} — $0.002. E.g. /llm/price/claude-sonnet-5 - Need ONE model's context window / capabilities → GET /llm/limit/{model} — $0.002 - Need "cheapest model that can do X" → GET /llm/cheapest?min_context=200000&vision=true — $0.005 - Know your workload shape? Add expected_input=2000&expected_output=500 (tokens/request) to /llm/cheapest to rank by TOTAL blended USD per request, not input sticker price. Add exclude_preview=true to skip pre-release models. - Comparing MANY models or building a routing table → GET /llm/prices — $0.01 for all 2,000+ models - Capability table for all models → GET /llm/limits — $0.01 - Watching for provider repricing → GET /llm/price-changes — $0.02 (diff feed, hourly snapshots) ## Cost stewardship - For fewer than ~5 model checks, single lookups ($0.002) beat buying the table ($0.01). - Tables refresh hourly — cache a purchased table for up to 60 minutes instead of re-buying. - Lookup misses return HTTP 404 WITH suggestions (closest model ids) — retry with a suggestion rather than buying the table to search. - Free evaluation: /preview/llm/prices, /preview/llm/limits, /preview/llm/price-changes (5 sample rows, no payment). ## Routing workflow recipe 1. GET /llm/cheapest with your constraints (context, modality, price cap) — $0.005. 2. GET /llm/limit/{model} on the top candidate to confirm capabilities — $0.002. 3. Use /llm/price-changes daily if your routing depends on price stability — $0.02. Total: ~$0.01 per routing decision, always against data ≤1h old. ## Response shape Tables: { generated_at, provider_count, model_count, models: [...] }. Lookups: { matched_id, generated_at, model: {...} }. Prices are USD per 1M tokens (input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok, batch_*). ## Provenance (verify our numbers) Every price row carries: source_url (the provider's official pricing page), first_observed_at (when our hourly aggregator first saw the model id — bounded by the table's first_observed_since, not launch date), and confidence (high = cross-verified against OpenRouter within 5%; medium = single source; low = sources disagree — check source_url yourself before relying on a low-confidence price). ## Other resources - OpenAPI contract: https://modelprices.xyz/openapi.json - MCP server (native agent tools): https://modelprices.xyz/mcp - Freshness health check: https://modelprices.xyz/healthz