Official LLM pricing, tracked in one place.
llm-pricing is a CLI-first pricing registry for major model providers. It fetches official pricing pages, parses the live data, writes normalized JSON artifacts, and serves a static web experience for browsing pricing and operational status.
Repository:
Live site:
This repo is built for a simple workflow:
- run one CLI command
- regenerate machine-readable pricing data
- publish the repo as a static site
- let automation keep everything fresh
Provider pricing is fragmented, inconsistent, and changes without warning.
If you compare model costs across OpenAI, Anthropic, Google, Qwen, Moonshot, Zhipu, and others, you usually end up with:
- a dozen tabs
- different currencies
- different page structures
- unclear update timing
- no reliable machine-readable output
llm-pricing fixes that by treating pricing aggregation as a build artifact, not a spreadsheet exercise.
- A CLI that fetches provider pricing and regenerates repo data.
- A unified pricing registry in
data/pricing.json. - An ops registry in
data/ops.jsonwith provider run status, timestamps, durations, success/fallback/failure mode, and failure reason. - A currency registry in
data/currency_rate.json, sourced from the European Central Bank daily reference feed. - A model metadata registry in
data/models.jsonfor comparison buckets, access type, openness, lifecycle, and metadata sources. - A benchmark registry in
data/benchmarks.jsonfor trusted benchmark definitions plus live benchmark scores from official leaderboards. - A root-hosted static pricing dashboard in
index.html. - A root-hosted ops dashboard in
ops.html. - A test suite that covers live fetches, parser drift, CLI output generation, and browser behavior.
Current provider implementations live under src/providers.
The repo currently supports live or rendered-official-page collection for:
- OpenAI
- Anthropic
- Mistral
- DeepSeek
- Qwen
- Moonshot
- MiniMax
- Zhipu
The project is designed so new providers can be added without changing the web layer. Add a provider fetcher, parser tests, and the CLI will include it in the next update run.
This project intentionally keeps the moving parts small:
src/cli/- generates all repo data artifacts
src/providers/- fetches and parses provider pricing pages
src/providers/lib/- shared fetch, HTML, number parsing, and pricing helpers
src/fx.ts- fetches and parses official currency rates
src/catalog.ts- builds source-backed model metadata and benchmark registries
data/- generated JSON artifacts committed to the repo
- root static files
index.html,main.js,styles.css,ops.html,ops.js
There is no backend. The repo itself is the product.
git clone https://github.com/benyue1978/llm-pricing.git
cd llm-pricing
npm installBuild once:
npm run buildGenerate fresh data:
npm run updatePreview the web app locally:
npm run web:devThen open:
http://localhost:4173/for pricinghttp://localhost:4173/ops.htmlfor provider run status
The CLI entrypoint is src/cli/index.ts, compiled to dist/cli/index.js.
npm run updateor:
node dist/cli/index.js updateWhat it does:
- fetches all provider pricing sources
- records provider-by-provider execution metadata
- fetches official daily FX rates
- writes:
data/pricing.jsondata/ops.jsondata/currency_rate.jsondata/models.jsondata/benchmarks.json
Typical output looks like:
Fetching openai pricing...
openai: live https://developers.openai.com/api/docs/pricing (46 models)
Fetching anthropic pricing...
anthropic: live official pricing page (10 models)
...
Updated data/pricing.json (288 models, updated_at=2026-03-10T04:19:47.338Z)
Updated data/ops.json (9 providers, updated_at=2026-03-10T04:19:47.338Z)
Updated data/currency_rate.json (30 currencies, updated_at=2026-03-09T00:00:00.000Z)
Updated data/models.json (288 models, updated_at=2026-03-10T04:19:47.338Z)
Updated data/benchmarks.json (5 benchmark definitions, updated_at=2026-03-10T13:32:14.298Z)
Print the current pricing registry:
node dist/cli/index.js printPrint the cheapest model by raw input price from pricing.json:
node dist/cli/index.js cheapestUnified pricing output:
{
"updated_at": "2026-03-10T04:19:47.338Z",
"models": [
{
"provider": "openai",
"model": "gpt-4.1",
"type": "text",
"input_price_per_million": 2,
"output_price_per_million": 8,
"currency": "USD",
"source": "https://platform.openai.com/pricing"
}
]
}Notes:
- prices are stored in each provider’s native currency
- the repo currently uses mostly
USDandCNY typeis the billing category, currently focused on text modelssourceis the official pricing page URL used for that entry
Provider execution status for the latest update run:
{
"updated_at": "2026-03-10T04:19:47.338Z",
"summary": {
"provider_count": 9,
"success_count": 9,
"failure_count": 0,
"live_count": 9,
"fallback_count": 0,
"model_count": 288
},
"providers": [
{
"provider": "openai",
"success": true,
"mode": "live",
"model_count": 46,
"started_at": "2026-03-10T02:44:28.334Z",
"finished_at": "2026-03-10T02:44:30.568Z",
"checked_at": "2026-03-10T02:44:30.568Z",
"duration_ms": 2234,
"message": "live https://developers.openai.com/api/docs/pricing (46 models)",
"messages": [
"live https://developers.openai.com/api/docs/pricing (46 models)"
],
"fail_reason": null
}
]
}This file is what the ops page reads.
FX rates used for display conversion on the web app:
{
"updated_at": "2026-03-09T00:00:00.000Z",
"source": "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml",
"base_currency": "EUR",
"rates": {
"EUR": 1,
"USD": 1.1555,
"CNY": 8.2881
}
}Source:
- European Central Bank daily euro foreign exchange reference rates
Why ECB:
- official central-bank source
- stable daily publication
- simple XML feed
- enough coverage for the currencies currently used by this repo
Source-backed model metadata for comparison-safe grouping:
{
"updated_at": "2026-03-10T04:19:47.338Z",
"sources": [
{
"id": "openai-models-docs",
"name": "OpenAI models documentation",
"kind": "provider_docs",
"url": "https://platform.openai.com/docs/models",
"official": true,
"scope": "metadata"
}
],
"models": [
{
"provider": "openai",
"model": "gpt-4.1-mini",
"family": "gpt-4.1",
"access_type": "api",
"openness": "closed",
"modalities": ["text"],
"comparison_buckets": ["low-cost", "text-models"],
"release_stage": "stable",
"context_window_tokens": null,
"max_output_tokens": null,
"parameter_count_billions": null,
"license": null,
"model_page_url": "https://platform.openai.com/docs/models",
"metadata_source_ids": ["openai-models-docs", "huggingface-model-cards"],
"pricing_source_url": "https://platform.openai.com/pricing",
"benchmark_ids": ["livebench_overall"],
"notes": [
"Do not compare this model globally by price alone."
]
}
]
}This file is meant to power:
- bucketed model comparisons
- metadata filters
- future context/license/openness views
Trusted benchmark definitions plus live score matches for price-efficiency analysis:
{
"updated_at": "2026-03-10T04:19:47.338Z",
"sources": [
{
"id": "swe-bench-official",
"name": "SWE-bench official leaderboard",
"kind": "benchmark_official",
"url": "https://www.swebench.com/",
"official": true,
"scope": "benchmark"
}
],
"benchmarks": [
{
"id": "livebench_overall",
"name": "LiveBench Overall",
"category": "general",
"metric_name": "mean task score",
"score_direction": "higher_is_better",
"source_url": "https://livebench.ai/",
"suitable_for_normalized_price": true
}
],
"results": [
{
"provider": "openai",
"model": "gpt-5.1-codex",
"benchmark_id": "livebench_overall",
"score": 72.14,
"score_unit": "points",
"evaluated_at": "2026-01-08",
"source_url": "https://livebench.ai/table_2026_01_08.csv",
"notes": null
}
]
}Current benchmark coverage includes:
livebench_overalllivebench_codinglivebench_agentic_codinglivecodebench_pass1swe_bench_bash_only
The site is fully static and root-hosted.
Files:
Features:
- search by provider, model, type, currency, or source
- provider filter
- type filter
- bucket filter for comparison-safe cohorts such as
frontier,reasoning,low-cost, andagentic-coding - specialized preset views for:
- general value
- frontier value
- coding value
- agentic coding
- strict code eval
- strict agent eval
- sorting by provider, model, type, native currency, input price, or output price
- benchmark-aware sorting by:
- benchmark score
- input price per benchmark point
- output price per benchmark point
- benchmark traceability panel with:
- official leaderboard link
- methodology link
- benchmark metric description
- visible source-row coverage summary
- display currency conversion:
- select
USDto convert all visible prices to USD - select
CNYto convert all visible prices to CNY
- select
- converted price sorting using
currency_rate.json - native currency still shown explicitly in the table for transparency
- benchmark-specific comparison modes backed by official sources:
- LiveBench for broad capability
- LiveCodeBench for coding
- SWE-bench bash-only for agentic coding
Files:
Features:
- per-provider status
- live vs fallback vs failed mode
- success flag
- model count
- duration
- last checked timestamp
- final status message
- failure reason, if any
Files:
Features:
- per-model native and FX-converted pricing
- comparison buckets and metadata context
- benchmark cards with:
- score
- evaluation date
- exact matched benchmark row names
- official source link
- methodology link
- provider ops status from
ops.json
npm run test:ciCoverage includes:
- schema defaults
- provider utility helpers
- provider parser fixtures
- live fetch validation against official sources
- CLI output generation
- FX parsing and conversion
- provider aggregation and ops metadata
npm run test:e2ePlaywright verifies:
- the pricing dashboard loads real generated artifacts
- search, filter, and sorting work
- display currency conversion changes rendered prices
- the ops page reads
ops.jsonand renders provider status rows
This repo is designed to be updated by automation.
The scheduled workflow should:
- install dependencies
- build the project
- run
npm run update - run
npm run test:ci - run
npm run test:e2e - commit updated data artifacts when they change
That makes the repo suitable for:
- GitHub Pages
- Vercel static hosting
- Cloudflare Pages
- any other static host that can serve the repo root
Important deployment note:
- data generation happens in GitHub Actions, not in the Vercel build
- Vercel should only run
npm run buildand serve the committeddata/*.jsonartifacts - this avoids provider-specific network differences between local, CI, and hosting environments
At a high level:
- identify the official pricing source
- build a parser against the real page structure
- add a manual fallback
- add fixture tests
- add a live sentinel test that fails if the structure drifts
- plug the provider into
src/providers/index.ts - run
npm run update
The provider utilities in src/providers/lib are there to keep this process consistent.
npm run build
npm run update
npm run test:ci
npm run test:e2e
npm run web:dev- Official sources first
- CLI-generated artifacts only
- Static-site deployment
- Parser drift should fail tests early
- Native provider currency preserved in source data
- Converted currency is a display concern, backed by a documented FX source
MIT