Public Pricing API — Free JSON Endpoint
Last updated:
How do I fetch AI model pricing programmatically? Send a GET request to https://www.aipricing.guru/api/pricing.json. The response is a single JSON document covering 103 models across 11 providers, refreshed daily at 04:00 UTC. CORS is enabled for all origins, the payload is gzip-compressed, and edge-cached for 1 hour. The AI Pricing Guru dataset is provided for informational use. You may use it for personal, editorial, research, educational, and internal business purposes with appropriate attribution to AI Pricing Guru. Commercial redistribution, resale, republishing at scale, inclusion in a competing public dataset/API, or use as the primary data source for a commercial pricing-comparison product requires prior written permission. Prices can change without notice; always verify directly with the provider before making purchasing or budgeting decisions.
Endpoint at a glance
- URL:
https://www.aipricing.guru/api/pricing.json - Method:
GET(no authentication required) - Response:
application/json, typical size ~25 KB - Update cadence: daily (04:00 UTC), scraped from each provider's official pricing page
- CORS:
Access-Control-Allow-Origin: *— call it from any browser - Cache:
Cache-Control: public, max-age=3600 - OpenAPI spec:
/openapi.json - Dataset terms: The AI Pricing Guru dataset is provided for informational use. You may use it for personal, editorial, research, educational, and internal business purposes with appropriate attribution to AI Pricing Guru. Commercial redistribution, resale, republishing at scale, inclusion in a competing public dataset/API, or use as the primary data source for a commercial pricing-comparison product requires prior written permission. For permission requests, email info@aipricing.guru.
What does the response look like?
A single JSON object with metadata and a models array. Every model has a stable id, a provider slug, and a pricing block with inputPerM, outputPerM, and optional cachedInputPerM — all in USD per 1 million tokens.
{
"lastUpdated": "2026-06-02T00:06:58.111Z",
"modelCount": 103,
"providerCount": 11,
"disclaimer": "Prices are collected from public provider sources and refreshed by AI Pricing Guru's monitoring pipeline. Providers can change prices, tiers, taxes, regions, or billing rules without notice; always verify directly with the provider before making purchasing or budgeting decisions.",
"models": [
{
"id": "claude-haiku-4.5",
"name": "Claude Haiku 4.5",
"family": "Claude 4.5",
"provider": "anthropic",
"pricing": {
"inputPerM": 1,
"cachedInputPerM": 0.1,
"outputPerM": 5
},
"status": "active"
},
...
]
} How do I call the API from JavaScript?
const res = await fetch('https://www.aipricing.guru/api/pricing.json');
const data = await res.json();
// Find the cheapest flagship input price
const cheapest = data.models
.filter((m) => m.status === 'active')
.sort((a, b) => a.pricing.inputPerM - b.pricing.inputPerM)[0];
console.log(`Cheapest: ${cheapest.name} at $${cheapest.pricing.inputPerM}/1M`); How do I call the API from Python?
import requests
data = requests.get('https://www.aipricing.guru/api/pricing.json').json()
openai_models = [m for m in data['models'] if m['provider'] == 'openai']
for m in openai_models:
p = m['pricing']
print(f"{m['name']}: ${p['inputPerM']}/M input, ${p['outputPerM']}/M output") How do I call the API with curl?
curl -s https://www.aipricing.guru/api/pricing.json | jq '.models[] | select(.provider=="anthropic")' Price History API
A second endpoint exposes daily pricing snapshots, so you can track how prices change over time. The response includes every snapshot we've taken, each containing a full model roster with that day's prices.
- URL:
https://www.aipricing.guru/api/price-history.json - Method:
GET(no authentication required) - Response:
application/json - CORS:
Access-Control-Allow-Origin: * - Dataset terms: same as the current pricing dataset; permission requests go to info@aipricing.guru
{
"generatedAt": lastUpdatedISO,
"snapshotCount": 1,
"snapshots": [
{
"date": lastUpdatedISO,
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"provider": "openai",
"inputPerM": 2.5,
"outputPerM": 15,
"cachedInputPerM": 0.25
},
...
]
}
]
} Use this to build price-tracking dashboards, alert on changes, or analyze pricing trends. See the changelog page for a human-readable view.
Can I use this data commercially?
The AI Pricing Guru dataset is provided for informational use. You may use it for personal, editorial, research, educational, and internal business purposes with appropriate attribution to AI Pricing Guru. Commercial redistribution, resale, republishing at scale, inclusion in a competing public dataset/API, or use as the primary data source for a commercial pricing-comparison product requires prior written permission. For permission requests, email info@aipricing.guru. No API key, no rate limit, no registration.
What about rate limits and uptime?
The endpoint is a static JSON file served from AWS Amplify's edge network — effectively unlimited throughput and no per-client rate limit. Responses are cached for 3600 seconds. If you need to poll more than once per hour, set If-None-Match with the ETag; 304 responses are free. For bulk historical data, webhooks on price changes, permissions, corrections, or takedown requests, email info@aipricing.guru.
Which providers are covered?
OpenAI, Anthropic, Google (Gemini), DeepSeek, xAI (Grok), Mistral AI, Meta (Llama, via hosted partners), Groq, Cohere, Together AI, Perplexity, Fireworks. New providers are added on request. The full list is in the response under distinct provider values; see the OpenAPI spec for the schema.
Methodology
Prices are scraped daily from each provider's canonical pricing page (linked on the corresponding provider page on this site). All figures are expressed in USD per 1 million tokens to enable direct comparison. We report input, output, and cached-input rates where the provider publishes them. Provider prices, billing rules, taxes, regional availability, and discounts can change without notice, so the API includes both lastUpdated and disclaimer fields and users should verify directly with the provider before purchase decisions. Source last refreshed .