If you're building a cost dashboard, automating budget reports, or integrating AI cost estimation into your product, you need programmatic access to pricing data and cost calculations.

APIpulse now offers two free calculator APIs alongside the existing pricing data API:

Both endpoints are free, require no API key, and support CORS for direct browser usage.

Calculate Costs for Any Model

The /api/calculate endpoint takes your token counts, request volume, and time period, then returns per-request, daily, monthly, and annual cost estimates.

# Single model — GPT-5 with 2K input / 500 output tokens, 1000 requests/day, 30 days curl "https://getapipulse.com/api/calculate?model=openai-gpt5&input_tokens=2000&output_tokens=500&requests=1000&days=30"

Response:

{ "model": "openai-gpt5", "name": "GPT-5", "provider": "OpenAI", "pricing": { "input_per_1m": 1.25, "output_per_1m": 10.00 }, "costs": { "per_request": 0.0075, "per_1k_requests": 7.5, "daily": 7.5, "monthly": 225.0, "annual": 2700.0 }, "mode": "standard" }

Compare Multiple Models at Once

Pass a comma-separated list of model IDs to get a side-by-side comparison, automatically sorted by cost:

curl "https://getapipulse.com/api/calculate?models=openai-gpt5,anthropic-sonnet46,deepseek-v4-pro,google-flash&input_tokens=3000&output_tokens=1000&requests=5000"

Returns all models ranked by monthly cost, with the cheapest flagged:

{ "results": [ { "name": "Gemini 2.5 Flash-Lite", "costs": { "monthly": 120.0 } }, { "name": "DeepSeek V4 Pro", "costs": { "monthly": 1966.5 } }, { "name": "GPT-5", "costs": { "monthly": 4500.0 } }, { "name": "Claude Sonnet 4.6", "costs": { "monthly": 6750.0 } } ], "cheapest": { "name": "Gemini 2.5 Flash-Lite", "monthly": 120.0 } }

Batch and Streaming Modes

API costs vary by delivery mode. The API supports three modes via the mode parameter:

ModeParameterEffect
Standardmode=standard (default)Normal pricing
Streamingmode=streaming+15% output tokens (real-world overhead)
Batchmode=batch50% discount (OpenAI Batch API pricing)
# Estimate costs with OpenAI's Batch API (50% off) curl "https://getapipulse.com/api/calculate?model=openai-gpt5&requests=10000&mode=batch"

Find the Cheapest Model

The /api/cheapest endpoint is designed for one question: "What's the cheapest model that fits my needs?"

By Budget

# What can I get for $50/month with 10K requests/day? curl "https://getapipulse.com/api/cheapest?budget=50&requests=10000"

By Use Case

# Best models for coding tasks curl "https://getapipulse.com/api/cheapest?use_case=coding" # Best models for chat, budget tier only curl "https://getapipulse.com/api/cheapest?use_case=chat&quality=budget"

By Cost Per Request

# Models that cost less than $0.01 per request curl "https://getapipulse.com/api/cheapest?max_cost_per_request=0.01"

JavaScript Integration

// Estimate costs for your workload async function estimateCost(modelId, monthlyRequests) { const url = `https://getapipulse.com/api/calculate?model=${modelId}&requests=${monthlyRequests / 30}&days=30`; const res = await fetch(url); const data = await res.json(); return data.costs.monthly; } // Find cheapest model under budget async function findCheapest(budget, requests) { const res = await fetch( `https://getapipulse.com/api/cheapest?budget=${budget}&requests=${requests}` ); const data = await res.json(); return data.recommendations[0]; }

Python Integration

import requests # Compare 5 models for a 50K request/day workload r = requests.get("https://getapipulse.com/api/calculate", params={ "models": "openai-gpt5,anthropic-sonnet46,deepseek-v4-pro,google-flash,mistral-large", "input_tokens": 3000, "output_tokens": 1000, "requests": 50000 }) data = r.json() for m in data["results"]: print(f"{m['name']:25s} ${m['costs']['monthly']:>10,.2f}/mo") print(f"\nCheapest: {data['cheapest']['name']} at ${data['cheapest']['monthly']:,.2f}/mo")

All 48 Supported Models

ProviderModel IDPrice (Input/Output per 1M)
OpenAIopenai-gpt55$5.00 / $30.00
OpenAIopenai-gpt5$1.25 / $10.00
OpenAIopenai-gpt5-mini$0.25 / $2.00
OpenAIopenai-gpt4o-mini$0.15 / $0.60
Anthropicanthropic-sonnet46$3.00 / $15.00
Anthropicanthropic-haiku$1.00 / $5.00
Googlegoogle-flash$0.10 / $0.40
Googlegoogle-flash-lite$0.075 / $0.30
DeepSeekdeepseek-v4-flash$0.14 / $0.28
Mistralmistral-small$0.15 / $0.60
Metallama-4-scout$0.18 / $0.34
...and 22 more. Full list in API docs.

Why Use a Cost Calculator API?

Budget Planning — Feed your actual usage data to get accurate monthly projections before committing to a provider.

Model Selection — Programmatically pick the cheapest model that meets your quality requirements. Run the comparison in CI/CD.

Cost Dashboards — Embed cost estimates in internal tools. Show stakeholders real numbers, not guesses.

Startup Budgeting — Compare all 67 models in one API call. Find the option that fits your runway.

API Reference

EndpointMethodDescription
/api/calculateGETCalculate costs for one or more models
/api/cheapestGETFind cheapest models by use case, budget, or quality
/api/pricingGETRaw pricing data for all 67 models

Full documentation with all parameters: getapipulse.com/api-docs.html

Try the Interactive Calculator

Prefer a visual interface? Our web calculator has the same data with charts, presets, and one-click model comparison.

Open Cost Calculator →

🎯 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 →

📊 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.

💸 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 Mistral Small 4 Alternatives?
5 models ranked by cost — some are 90% cheaper.
See 5 Mistral Small 4 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. 67 models, auto-updating.
Get the Free Widget → Free MCP Server →

Want to optimize your AI API costs?

APIpulse includes free cost comparisons, exports, and recommendations that can save you up to 40%.

Free Cost Audit →