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 55 models across 10 providers, refreshed daily at 04:00 UTC. CORS is enabled for all origins, the payload is gzip-compressed, and edge-cached for 1 hour. Free to use under CC-BY 4.0 with attribution.
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 - License: CC-BY 4.0 — attribution requested: "Data: 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-04-17T11:51:11.321Z",
"modelCount": 55,
"providerCount": 10,
"models": [
{
"id": "gpt-5.4",
"name": "GPT-5.4",
"family": "GPT-5.4",
"provider": "openai",
"pricing": {
"inputPerM": 2.5,
"cachedInputPerM": 0.25,
"outputPerM": 15
},
"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: * - License: CC-BY 4.0
{
"generatedAt": "2026-04-16T...",
"snapshotCount": 1,
"snapshots": [
{
"date": "2026-04-16",
"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?
Yes. The dataset is licensed under CC-BY 4.0, which permits commercial use, redistribution, and derivative works. The one requirement is attribution: include a visible credit like "Pricing data: aipricing.guru" linking back to https://www.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 or webhooks on price changes, email hello@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. Source last refreshed .