LLM Pricing API: Get AI Model Costs as JSON
Need to access LLM pricing data programmatically? Whether you're building a cost dashboard, a CI/CD pipeline that checks for price changes, or a model selection tool — you need reliable, up-to-date pricing data in a machine-readable format.
That's why we built the APIpulse LLM Pricing API — a free, no-auth JSON endpoint that returns current pricing for 33 AI models across 10 providers.
Quick Start
Get all models with a single GET request:
curl "https://getapipulse.com/api/pricing"
Response includes 33 models with input/output costs, context windows, and provider metadata:
{
"models": [
{
"id": "openai-gpt55",
"name": "GPT-5.5",
"provider": "OpenAI",
"tier": "Premium",
"input": 5.00,
"output": 30.00,
"context": "1M"
},
...
],
"meta": {
"count": 32,
"providers": ["OpenAI", "Anthropic", "Google", ...],
"lastUpdated": "2026-04-27"
}
}
Filter by Provider
Narrow results to a specific provider:
# Get all OpenAI models
curl "https://getapipulse.com/api/pricing?provider=openai"
# Get all Anthropic models
curl "https://getapipulse.com/api/pricing?provider=anthropic"
# Get all budget-tier models
curl "https://getapipulse.com/api/pricing?tier=budget"
Get a Single Model
Fetch pricing for a specific model by ID:
curl "https://getapipulse.com/api/pricing?model=openai-gpt4o-mini"
Use It in JavaScript
// Find the cheapest model for your workload
const res = await fetch('https://getapipulse.com/api/pricing?tier=budget');
const { models } = await res.json();
const inputTokens = 2000, outputTokens = 500;
const monthlyRequests = 30000;
const costs = models.map(m => ({
name: m.name,
monthlyCost: (inputTokens * monthlyRequests / 1e6) * m.input
+ (outputTokens * monthlyRequests / 1e6) * m.output
})).sort((a, b) => a.monthlyCost - b.monthlyCost);
console.log(`Cheapest: ${costs[0].name} at $${costs[0].monthlyCost.toFixed(2)}/mo`);
Use It in Python
import requests
# Get all models and find the cheapest for chatbot workloads
r = requests.get("https://getapipulse.com/api/pricing")
models = r.json()["models"]
for m in sorted(models, key=lambda x: x["input"]):
print(f"{m['name']:25s} ${m['input']:.2f}/${m['output']:.2f} per 1M tokens")
Use Cases
Cost Dashboards — Build internal tools that track AI spending across teams and projects.
CI/CD Price Checks — Alert your team when a model's price changes before deploying to production.
Model Selection — Programmatically pick the cheapest model that meets your quality requirements.
Budget Calculators — Power your own cost estimation tools with real-time pricing data.
Supported Providers
| Provider | Slug | Models |
|---|---|---|
| OpenAI | openai | 9 (GPT-5.5, GPT-5, GPT-4o, GPT-oss, etc.) |
| Anthropic | anthropic | 5 (Claude Opus 4.7, Sonnet 4.6, Haiku 4.5) |
google | 3 (Gemini 3.1 Pro, 2.5 Pro, 2.0 Flash) | |
| DeepSeek | deepseek | 3 (V4 Pro, V4 Flash, V3) |
| Mistral | mistral | 2 (Large, Small) |
| Cohere | cohere | 2 (Command R+, Command R) |
| Meta (Together.ai) | together | 4 (Llama 4 Scout/Maverick, Llama 3.1) |
| Moonshot | moonshot | 1 (Kimi K2.6) |
| xAI | xai | 2 (Grok 3, Grok 3 Mini) |
| AI21 | ai21 | 1 (Jamba 1.5 Large) |
Why Use This API?
- Free forever — No API key, no rate limits, no signup
- Always current — Pricing data verified monthly against provider pages
- CORS enabled — Use directly from browser-based tools
- 33 models — The most comprehensive LLM pricing dataset available
- 10 providers — OpenAI, Anthropic, Google, DeepSeek, Mistral, Cohere, Meta, Moonshot, xAI, AI21
Attribution
This API is free to use. We appreciate a link back to getapipulse.com when possible.
Try the Full Calculator
Need more than raw pricing data? Our calculator estimates monthly costs for your specific usage patterns.
Open Cost Calculator →