Guide April 29, 2026 · 5 min read

LLM Pricing API: Get AI Model Costs as JSON

⚠️ Claude 4 Deprecation Alert: Claude 4 models retire on June 15, 2026 (). If you use Claude 4, see our last-chance migration guide or use the deprecation calculator.

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 42 AI models across 10 providers.

Quick Start

Get all models with a single GET request:

curl "https://getapipulse.com/api/pricing"

Response includes 42 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": 34, "providers": ["OpenAI", "Anthropic", "Google", ...], "lastUpdated": "2026-05-29" } }

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

ProviderSlugModels
OpenAIopenai9 (GPT-5.5, GPT-5, GPT-4o, GPT-oss, etc.)
Anthropicanthropic5 (Claude Opus 4.7, Sonnet 4.6, Haiku 4.5)
Googlegoogle3 (Gemini 3.1 Pro, 2.5 Pro, 2.0 Flash)
DeepSeekdeepseek3 (V4 Pro, V4 Flash, V3)
Mistralmistral2 (Large, Small)
Coherecohere2 (Command R+, Command R)
Meta (Together.ai)together4 (Llama 4 Scout/Maverick, Llama 3.1)
Moonshotmoonshot1 (Kimi K2.6)
xAIxai2 (Grok 3, Grok 3 Mini)
AI21ai211 (Jamba 1.5 Large)

Why Use This API?

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 →

📊 Generate Your Personalized API Cost Report

Select your model, enter your monthly spend, and get a custom savings report with cheaper alternatives — free, in 60 seconds.

Generate My Report →

🎯 Rate Your API Setup in 30 Seconds

Get an A+ to F grade on your AI API costs. See how you compare and find cheaper alternatives instantly.

Get Your Cost Score →

Found this useful? Share it:

💸 Looking for DeepSeek V4 Flash Alternatives?
5 models ranked by cost — some offer better quality at similar prices.
See 5 DeepSeek V4 Flash Alternatives →
💸 Looking for Sonnet 4.6 Alternatives?
5 models ranked by cost — some are 90% cheaper.
See 5 Sonnet 4.6 Alternatives →
💸 Looking for Llama 4 Maverick Alternatives?
5 models ranked by cost — some are 95% cheaper.
See 5 Llama 4 Maverick Alternatives →
💸 Looking for Mistral Small 4 Alternatives?
5 models ranked by cost — some are 90% cheaper.
See 5 Mistral Small 4 Alternatives →
💸 Looking for Gemini 3.1 Pro Alternatives?
5 models ranked by cost — some are 95% cheaper.
See 5 Gemini 3.1 Pro Alternatives →
💸 Looking for Llama 4 Scout Alternatives?
5 models ranked by cost — some are 95% cheaper.
See 5 Llama 4 Scout Alternatives →
🔧 Free Embeddable Pricing Widget
Add live AI API pricing to your docs, blog, or README with one script tag. 42 models, auto-updating.
Get the Free Widget →

Want to optimize your AI API costs?

APIpulse Pro ($29 one-time) includes saved scenarios, cost report exports, and personalized recommendations that can save you up to 40%.

Get Pro — $29