Agent Cost Compare API
The same LLM token prices and agent cost-model engine that power this site, as a clean JSON API. Pull live-maintained list prices for 18 models across 7 providers, or POST your agent workflow and get cost-per-task, monthly spend, waste, and a cheaper-routing suggestion back.
Base URL
https://agentcostcompare.com/api/v1Authentication
The fastest way to get a key and start sending requests is through the API marketplace listing. The API accepts an X-API-Key header (or the marketplace proxy header). During the open beta you can also call it without a key.
curl https://agentcostcompare.com/api/v1/models \
-H "X-API-Key: YOUR_KEY"Response shape
Success returns { data, meta }; errors return { error: { code, message } }. The meta block always carries pricesUpdated and a pricing disclaimer.
Endpoints
/models?provider=anthropic or ?tier=frontier.curl "https://agentcostcompare.com/api/v1/models?provider=anthropic"/models/{id}claude-opus-4-8./providers/presetspresetId in an estimate and override only what you need./estimatepresetId as a baseline plus any overrides; add "compare": true to rank every model instead of pricing one.curl -X POST https://agentcostcompare.com/api/v1/estimate \
-H "Content-Type: application/json" \
-d '{
"presetId": "coding",
"modelId": "claude-opus-4-8",
"tasksPerMonth": 2000,
"promptCaching": true
}'Same call as a quick GET:curl "https://agentcostcompare.com/api/v1/estimate?presetId=coding&modelId=claude-opus-4-8&compare=true"Machine-readable spec
Import the OpenAPI 3.0 spec into Postman, RapidAPI, or a client generator.
Limits & disclaimer
Soft rate limit of ~120 requests/min per IP on the open tier. Prices are public list prices, directional only, and change frequently — verify against each provider's pricing page before relying on them. Not affiliated with any provider.
Metered plans (billing and quota handled for you) are listed on the API marketplace. Drop your marketplace listing link here once it's live.