AI Cost Calculator API

Compare token costs across 22 models. Find the cheapest AI for your workload in one API call.

The Problem

You're picking between GPT-4o, Claude Sonnet, Gemini Pro... but which one actually costs less for YOUR workload? Pricing pages are confusing. Token math is annoying.

OpenAIAnthropicGoogleMistralDeepSeekMetaGPT-4.1o3Gemini 2.5DeepSeek V3

Calculate Cost

Exact cost for any model given input/output tokens. Supports batch pricing.

Compare Models

Side-by-side cost comparison across all providers for the same workload.

Find Cheapest

One call to find the cheapest model that fits your budget and token needs.

Monthly Estimate

Forecast monthly spend based on daily request volume and token usage.

Token Estimator

Estimate token count from raw text. No tokenizer library needed.

MCP Ready

Works with Claude Code, Cursor, and any MCP-compatible tool.

Free

$0/mo
  • All calculation endpoints
  • 30+ model pricing data
  • Compare & cheapest finder
  • MCP integration

Pro

$29/mo
  • Everything in Free
  • Bundled with AI Spend Tracker
  • Usage logging & budgets
  • Cost forecasting
  • Optimization recommendations
  • Priority support
Get API Key — $29/mo Free Trial

Quick start — compare costs in one call:

curl -X POST https://api.lazy-mac.com/ai-cost/api/v1/compare \ -H "Content-Type: application/json" \ -d '{"input_tokens":1000,"output_tokens":500}'

Find the cheapest model under your budget:

curl "https://api.lazy-mac.com/ai-cost/api/v1/cheapest?input_tokens=1000&output_tokens=500&budget=0.01"

Part of the AI FinOps Suite — pairs with AI Spend Tracker for full cost visibility.