llerandi/llm-price-tracker:每日更新的 LLM 价格追踪项目
llerandi/llm-price-tracker
llerandi/llm-price-tracker 是一个每日更新的 LLM 定价参考项目,覆盖 17 家提供商共 64 个模型的输入/输出 token 价格、上下文窗口与能力,以 JSON 形式提供并支持程序化调用。
A daily-updated reference of LLM model pricing across all major providers. One source of truth for input/output token costs, context windows, and capabilities - structured as JSON so you can consume it programmatically.
Live site: llerandi.github.io/llm-price-tracker - sortable, filterable table updated daily.
Pricing Table
Prices in USD per 1 million tokens. Sorted by provider, then by input price.
| Provider | Model | Input ($/1M) | Output ($/1M) | Context | Capabilities |
|---|---|---|---|---|---|
| AI21 Labs | Jamba 1.7 Large | $2.00 | $8.00 | 256K | tools |
| Amazon Bedrock | Nova Micro | $0.04 | $0.14 | 128K | tools |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | 200K | vision, tools |
| Azure OpenAI | GPT-5.4 Nano | $0.20 | $1.25 | 1M | vision, tools |
| Cerebras | GPT-OSS 120B | $0.35 | $0.75 | 128K | tools |
| Cohere | Command R7B | $0.04 | $0.15 | 128K | tools |
| DeepSeek | DeepSeek V4 | $0.07 | $0.28 | 64K | tools |
| Fireworks AI | DeepSeek V4 Flash | $0.14 | $0.28 | 128K | tools |
| Text Embedding 005 | $0.01 | N/A | 2K | - | |
| Groq | Llama 4 Scout | $0.05 | $0.08 | 128K | vision, tools |
| Mistral | Devstral Small 2 | $0.10 | $0.30 | 128K | tools |
| OpenAI | Text Embedding 3 Small | $0.02 | N/A | 8K | - |
| Perplexity | Sonar | $1.00 | $1.00 | 128K | - |
| Qwen | Qwen3 Turbo | $0.08 | $0.25 | 128K | tools |
| Together AI | Llama 4 Scout | $0.18 | $0.59 | 128K | vision, tools |
| Voyage AI | Voyage 4 Lite | $0.02 | N/A | 32K | - |
| xAI | Grok Build 0.1 | $1.00 | $2.00 | 256K | tools |
| Showing the cheapest model per provider (17 providers shown, 64 models total). View all models with filters and comparison → |
Batch and Cache Pricing
Some providers offer discounted rates for asynchronous (batch) processing and prompt caching. Prices in USD per 1 million tokens.
- Batch: requests are queued and processed asynchronously (typically within 24 hours) at ~50% off standard rates.
- Cache read: tokens served from the prompt cache at a fraction of the standard input cost.
- Cache write: tokens written to the cache, billed once at a slight premium over the standard input cost (Anthropic and GPT-5.6 models).
Batch and cache pricing is available for select models. See full pricing table →
Official batch and caching docs: Anthropic batch - Anthropic caching - OpenAI batch - OpenAI caching
Notes on specific models:
- Gemini 2.5 Pro: input $2.50/1M and output $15.00/1M above 200K tokens.
- GPT-5.6 Sol, Terra, and Luna: requests above 272K tokens charged at 2x input and 1.5x output.
- Perplexity Sonar models: token prices above exclude a per-request fee of $5-14/1K requests (varies by search context size).
Official pricing pages: AI21 Labs - Amazon Bedrock - Anthropic - Cohere - Fireworks AI - Google - Mistral - OpenAI - Perplexity - Together AI - xAI
Embeddable Badges
Add a live price badge to any README. Badges update daily and are served via jsDelivr CDN.
URL pattern:
https://img.shields.io/endpoint?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fgh%2Fllerandi%2Fllm-price-tracker%40main%2Fdata%2Fbadges%2F{model-id}-{input|output|context}.json
Model IDs with slashes (e.g. Fireworks AI, Together AI) have the / replaced with - in the filename. Browse all IDs in data/prices.json or check data/badges/.
Example - Claude Sonnet 5 input price:
[](https://llerandi.github.io/llm-price-tracker/)
Use the live site to browse all models and copy badge embed code directly.
API Reference
All endpoints are static JSON files served via jsDelivr CDN with full CORS support (Access-Control-Allow-Origin: *). No API key required. Updated and CDN-purged daily at 06:00 UTC.
Base URL: https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main
| Endpoint | Description |
|---|---|
/data/prices.json |
All models from all providers |
/data/latest.json |
Permanent alias for prices.json - stable URL that always points to the current data |
/data/providers/{provider}.json |
Models for a single provider (e.g. anthropic, openai, google, mistral, cohere, together-ai, fireworks-ai, ai21-labs, xai, perplexity, amazon-bedrock, deepseek, groq, qwen) |
/data/history/YYYY-MM-DD.json |
Price snapshot for a given date |
/data/history_summary.json |
Consolidated time-series of input/output prices for all models (used by the price history chart) |
/data/feed.xml |
Atom 1.0 feed of daily price changes - subscribe in any RSS reader |
/data/changelog.md |
All price changes and model additions/removals, newest first |
/data/badges/{model-id}-input.json |
shields.io endpoint badge for input price |
/data/badges/{model-id}-output.json |
shields.io endpoint badge for output price |
/data/badges/{model-id}-context.json |
shields.io endpoint badge for context window |
Model IDs that contain / (Fireworks AI, Together AI) use - in badge filenames.
Schema stability
The JSON schema is stable. New fields may be added in future but existing fields will not be renamed or removed without a deprecation period. input_per_1m_usd, output_per_1m_usd, context_window_k, and all boolean capability fields are guaranteed to remain in the schema. Optional fields (batch_*, cache_*, notes) are present only when data is available; treat their absence or null as equivalent.
Endpoints
Get all models (curl):
curl https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/prices.json
Get models for a single provider (curl):
curl https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/providers/anthropic.json
Filter by price (Python, no dependencies):
import urllib.request, json url = "https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/prices.json" with urllib.request.urlopen(url) as r: data = json.load(r) cheap = [m for m in data["models"] if (m["input_per_1m_usd"] or 999) < 1.0] for m in cheap: print(f"{m['provider']} {m['model_name']}: ${m['input_per_1m_usd']}/1M in")
Filter by capability (JavaScript):
const res = await fetch( "https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/prices.json" ); const { models } = await res.json(); // Models with vision support under $5/1M input const visionModels = models.filter( m => m.supports_vision && (m.input_per_1m_usd ?? Infinity) < 5 );
Get a specific provider (JavaScript):
const res = await fetch( "https://cdn.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/providers/anthropic.json" ); const { models } = await res.json();
JSON Schema
Each entry in models contains:
| Field | Type | Description |
|---|---|---|
provider |
string | Provider display name (e.g. "OpenAI") |
model_id |
string | API identifier used when calling the provider |
model_name |
string | Human-readable model name |
input_per_1m_usd |
number or null | Input cost per 1M tokens in USD |
output_per_1m_usd |
number or null | Output cost per 1M tokens in USD |
context_window_k |
integer or null | Context window size in thousands of tokens |
supports_vision |
boolean | Accepts image inputs |
supports_function_calling |
boolean | Supports tool/function call syntax |
is_reasoning |
boolean | Chain-of-thought / extended thinking model |
tier |
string | "efficient", "performance", "flagship", or "specialized" |
notes |
string or null | Pricing caveats or special conditions |
batch_input_per_1m_usd |
number or null | Asynchronous batch input price (optional) |
batch_output_per_1m_usd |
number or null | Asynchronous batch output price (optional) |
cache_read_per_1m_usd |
number or null | Prompt cache read price (optional) |
cache_write_per_1m_usd |
number or null | Prompt cache write price (optional) |
Top-level fields in prices.json:
| Field | Type | Description |
|---|---|---|
last_updated |
string | ISO 8601 date of the last update ("YYYY-MM-DD") |
models |
array | Array of model objects (see above) |
Client Libraries
Installable wrappers around the jsDelivr JSON API. Both are zero-dependency and read-only.
JavaScript / TypeScript (Node >= 18 and browsers)
npm install llm-price-tracker
const { fetchPrices, getModel, getProvider } = require("llm-price-tracker"); // All models const { models } = await fetchPrices(); // Single model const sonnet = await getModel("claude-sonnet-5"); console.log(sonnet.input_per_1m_usd); // 2.00 // All models for a provider const { models: anthropicModels } = await getProvider("anthropic");
Source: packages/npm/
Python (>= 3.9, no dependencies)
pip install llm-price-tracker
from llm_price_tracker import fetch_prices, get_model, get_provider # All models data = fetch_prices() # Single model sonnet = get_model("claude-sonnet-5") print(sonnet["input_per_1m_usd"]) # 2.0 # All models for a provider anthropic = get_provider("anthropic")
Source: packages/python/
Contributing
Prices change frequently. If you spot an outdated entry or a missing model, contributions are welcome.
- Fork the repository and create a branch.
- Edit
data/prices.jsonwith the correct values. - Run
python scripts/validate.pyto check the schema. - Run
python scripts/verify_prices.pyto check consistency (prices positive, batch <= standard, no duplicates). - Run
python scripts/update_prices.pyto regenerate the README table. - Open a pull request with a link to the official pricing page as evidence.
To add a new provider, add a new entry in data/prices.json following the existing schema.
How It Works
A GitHub Actions workflow (update.yaml) runs daily at 06:00 UTC. It runs scripts/update_prices.py, which:
- Sorts all entries by provider and input price.
- Updates the
last_updatedtimestamp inprices.json. - Regenerates the pricing table in this README using HTML comment markers as boundaries.
- Writes a compact daily snapshot to
data/history/YYYY-MM-DD.jsonwith just the pricing fields. - Commits and pushes if there are changes.
A second workflow (ci.yaml) runs on every push and pull request to lint the scripts and validate the JSON schema.
Troubleshooting
The live site or badges show stale data.
The daily workflow automatically purges the jsDelivr CDN cache after each push, so data is normally fresh within seconds. If you are still seeing stale data, hard-refresh the live site (Ctrl+Shift+R on Windows/Linux, Cmd+Shift+R on Mac). To force a manual purge for a specific file, open this URL in your browser:
https://purge.jsdelivr.net/gh/llerandi/llm-price-tracker@main/data/prices.json
Roadmap
Phase 1 - Foundation
- JSON schema definition
- Initial pricing data: Anthropic, Google, Mistral, OpenAI
- Auto-generated README pricing table from JSON
- CI pipeline (lint + JSON validation)
- Daily automated update workflow
Phase 2 - Expand
- Add providers: Cohere, Together AI, Fireworks AI, AI21 Labs
- Add batch pricing and prompt caching columns
- Track price history with daily snapshots
Phase 3 - Tooling
- GitHub Pages site with sortable and filterable table
- Embeddable price badge for other repositories
- REST-like endpoint via jsDelivr CDN with CORS support
Phase 4 - Insights
- Price history chart on the live site (visualize changes over time per model)
- Auto-generated changelog: markdown summary of price changes by date
- Cost calculator on the live site (tokens x price = estimated cost)
- Add providers: xAI (Grok), Perplexity, AWS Bedrock
Phase 5 - Community
- Automated price verification: script that cross-checks prices against official pages
- Support for multiple currencies (EUR, GBP) on the live site
- npm / PyPI package wrapping the jsDelivr JSON endpoint
Phase 6 - Automation and Discovery
- Automated GitHub Issue when a price changes by more than 10% (subscribe via Watch -> Issues)
- RSS/Atom feed of price changes, generated daily and served as static XML via jsDelivr CDN
- Add providers: DeepSeek, Groq, Qwen (Alibaba Cloud)
- Filters on the live site by tier, capabilities, and max price
- Model comparison view: select two models for a side-by-side diff
Phase 7 - Polish and Reach
- Dark mode with manual toggle (light by default, persisted in localStorage)
- data/latest.json permanent alias for the current prices
- Weekly price summary posted to GitHub Discussions every Monday
- SEO: sitemap.xml, Open Graph meta tags, JSON-LD structured data
- Embeddable context window badge (alongside existing price badges)
- Export current filtered table as CSV
- Shareable URLs: query params preserve active filters and comparison
- Changelog section on the live site
- Cost calculator presets (10-page PDF, code review, 1K support chats, article summary)
- Embedding model pricing (OpenAI, Google, Cohere, Voyage AI)
- More currencies: JPY, CAD, AUD (with fallback rates if API fails)
- Provider stats: aggregate summary per provider on the live site
Phase 8 - CDN Reliability and API
- Auto-purge jsDelivr CDN cache after every daily update (prices, badges, feed, providers)
- API documentation: stable schema contract, curl and JS/Python examples, versioning policy
Phase 9 - Coverage
- Add Azure OpenAI pricing
- Add Cerebras pricing
License
来源:GitHub · github.com