SpendLint

Catch AI API cost regressions before they ship

One verified dataset of official LLM API prices, workload cost computed from it, and a budget CI enforces.

This is what a one-line model change looks like to SpendLint. The pull request swaps Claude Sonnet 5 for Claude Opus 5 on a workload of 1,000 requests a day. The contract below allows $500 a month and a 20% rise, so the check fails and names the rules that broke.

ChangeWorkloadModelTokens per requestPer requestPer month
−BaselineClaude Sonnet 53,000 input, 600 output$0.01$360.00
+ProposedClaude Opus 53,000 input, 600 output$0.03$900.00
=Delta per month (+150.00%)FAIL+$540.00

1,000 requests per day, 30 day monthPrices effective 2026-10-22Verified Source Anthropic

Rules violated: max_monthly_usd, max_cost_per_request_usd, max_regression_pct. 5 cheaper models satisfy the contract. Check a contract with your own numbers.

Flagship model prices today

ModelInput per 1MOutput per 1MVerifiedFull table
Claude Sonnet 5$2.00$10.00All Anthropic prices
GPT-5.4$2.50$15.00All OpenAI prices
Gemini 3.1 Pro Preview$2.00$12.00All Google (Gemini API) prices
GPT-5$1.25$10.00All Azure OpenAI (Foundry Models) prices
USD per 1 million tokens, standard tier, read from each provider's official price page.

Cheapest current models for a 3,000 in, 600 out workload

ModelProviderPer requestPer month at 1,000 req/day
GPT-5 nanoAzure OpenAI (Foundry Models)$0.000390$11.70
GPT-5 nanoOpenAI$0.000390$11.70
GPT-4.1 nanoAzure OpenAI (Foundry Models)$0.000540$16.20
Gemini 2.5 Flash-LiteGoogle (Gemini API)$0.000540$16.20
GPT-4.1 nanoOpenAI$0.000540$16.20
GPT-4o miniAzure OpenAI (Foundry Models)$0.000810$24.30
GPT-4o miniOpenAI$0.000810$24.30
GPT-5.6 LunaOpenAI$0.001320$39.60

Compare every model side by side or price your own workload.

Budget contracts

Add a spendlint.yaml to your repository, describe the workload, and the GitHub Action reports PASS, WARN or FAIL with the projected before and after cost and the rule that broke.

version: 1
rules:
  max_monthly_usd: 500
  max_cost_per_request_usd: 0.02
  max_regression_pct: 20
npx spendlint check --contract spendlint.yaml --workload workload.json --baseline workload.baseline.json

For the swap above the command exits 1 and prints FAIL, the delta of +$540.00 per month (+150.00%), the violated rules and the cheaper compliant models. Check a contract in the browser, or read the setup guide.

What SpendLint does not do

Reference pages

Claude API pricing
Every Claude model with input, output, cache and batch prices.
OpenAI API pricing
GPT-5.x, o-series and mini models, cached input and batch.
Gemini API pricing
Gemini 3.x and 2.5 with long-context tiers and promotional periods.
Azure OpenAI pricing
Global Standard list prices from the Azure Retail Prices API.
Claude Code cost
What a developer seat costs per day and month, with Anthropic's own figures.
JSON API
The same dataset as machine-readable JSON with provenance on every row.