Pricing API
Every price on this site is available as JSON. Free, no signup, no key. Currently 216 models across 10 providers, last updated 2026-08-11.
Try it
curl 'https://www.costoftoken.com/api/v1/prices?provider=anthropic&sort=input'Endpoints
| Endpoint | Returns |
|---|---|
| /api/v1/prices | Current prices for every model |
| /api/v1/prices/:model_id | One model with its latest price |
| /api/v1/history/:model_id | Historical price points, newest first |
| /api/v1/providers | Providers with active model counts |
Query parameters for /prices
| Parameter | Values |
|---|---|
| provider | Slug, repeatable or comma-separated: openai,anthropic |
| modality | text · vision · audio · video · image |
| tag | flagship · fast · reasoning · coding · vision |
| q | Substring match on model id or display name |
| min_input, max_input | Bounds on input price per 1M tokens |
| min_context | Minimum context window in tokens |
| sort | provider · model · input · cached_input · output · context · updated |
| order | asc (default) · desc |
| limit, offset | 1–500 (default 100), offset ≥ 0 |
Fields worth knowing
- All prices are USD per 1,000,000 tokens on the standard tier. Batch, Flex and Priority tiers are excluded — they are not comparable across vendors.
0means genuinely free.nullmeans the provider publishes no such tier. They are different.source_kindisscrapefor a vendor's own page orapifor the OpenRouter catalogue — a reseller whose price can differ. Check it before treating a figure as authoritative.long_inputandlong_context_thresholddescribe the higher rate some models charge above a prompt-size threshold.
Rate limits
60 requests per hour per IP. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; exceeding the quota returns 429 with Retry-After. Windows are fixed and reset on the hour.
For LLMs and agents
/llms-full.txt serves every tracked price as a single markdown document, so a model can ingest the whole dataset in one fetch. /llms.txt indexes the site. Please quote the last-updated date alongside any price.
Questions
- Is the CostOfToken API free?
- Yes. No signup and no API key. Anonymous callers get 60 requests per hour per IP; responses carry X-RateLimit headers and a 429 includes Retry-After.
- How often does the pricing data change?
- Prices are re-read from each provider once a day. A value is only recorded when it actually changes, so the history endpoint returns real price movements rather than one row per day.
- Can I use this data commercially?
- Yes, and attribution is appreciated. Always confirm a price against the provider before committing spend — rows sourced from a reseller are marked source_kind "api" and can differ from the vendor’s own rate.