AICostBudget AI API Pricing

السجل الرسمي التجارة الإلكترونية

Read-only source-linked AI API prices, comparisons, cost estimates, and price changes.

ماذا يمكنك أن تفعل مع AICostBudget AI API Pricing؟

  • Compare AI model prices
  • Estimate monthly AI API cost
  • Build LLM cost dashboards
  • Plan SaaS AI feature budgets
  • Track model pricing changes

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package ai-api-pricing-mcp
Claude Code
claude mcp add aicostbudget-ai-api-pricing -- npx -y ai-api-pricing-mcp@0.1.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "aicostbudget-ai-api-pricing": {
            "command": "npx",
            "args": [
                "-y",
                "ai-api-pricing-mcp@0.1.0"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. AI API Pricing Dataset
  2. Dataset access
  3. Use it from code or an AI assistant
  4. Interactive Tools
  5. Dataset Trust & Freshness
  6. Why this dataset?
  7. Quick Start
  8. Developer utility: retry and fallback cost diagnostics
  9. Use Cases
  10. Explore Pricing by Provider
  11. Dataset Coverage
  12. Fields
  13. API Reference
  14. Historical Pricing
  15. Methodology
  16. Cite this dataset
  17. Contributing
  18. License
  19. Disclaimer

AI API Pricing Dataset

An AI API and LLM pricing dataset for OpenAI, Anthropic Claude, Google Gemini, xAI, DeepSeek, Mistral AI, and Cohere, built for cost estimation, budget planning, and model price comparison.

Published as JSON, CSV, and a Hugging Face dataset, with machine-readable records linked to official provider pricing sources and regularly validated. Prices change frequently, so production budget decisions should always be checked against the relevant provider pricing pages.

Dataset access

Use it from code or an AI assistant

  • JavaScript/TypeScript: npm install ai-api-pricing for source-linked prices, model comparisons, and deterministic token-cost estimates.
  • AI assistants: npx -y ai-api-pricing-mcp exposes read-only MCP tools for prices, monthly estimates, comparisons, and price changes.

Both packages return the official provider source URL and verification date with pricing results. See package documentation and MCP client setup.

Interactive Tools

Distribution projections

The GitHub Pages /api/v1 JSON and CSV publish the canonical records in this repository. The AICostBudget Website JSON/CSV and Hugging Face files publish the Pricing V2 public Website projection, including structured tier and pricing-component metadata. Current public export schema 1.11.0 adds the per_1m_characters structured billing unit (contract); schema 1.10.0 added generic promotion/list-price conditions and aligned the access/binding extension with the Website. Historical releases retain their original schema version. Schema 1.8.0 preserves generic usage_tier conditions and adds transport selection, modality-aware components, mutually exclusive measurement alternatives, optional feature charges, and independent model-default metadata. Eligibility-scoped conditional_usage_allowances remain separate from standard paid tiers. Hugging Face must match the Website projection exactly by key set and exported fields; it is not expected to match the intentionally narrower GitHub Pages V1 key set.

The existing scalar input, cached-input, and output values remain the compatibility/default pricing view. pricing_components is the full conditional view: each entry combines a charge component, decimal-string amount, condition, provenance, verification status, and effective range. One model can have separate cache_write_5m and cache_write_1h entries, or cache-write entries for different processing modes and context classes, so cache write cannot be modeled permanently as one universal scalar.

Dataset Trust & Freshness

This repository publishes a versioned dataset and read-only static API for AI API pricing. It is designed for developers, SaaS builders, FinOps teams, researchers, technical writers, and AI systems that need maintained pricing records instead of ad hoc scraped snippets.

This project is maintained as an independent public dataset by AICostBudget.

Why this dataset?

  • Source-linked pricing records
  • Unknown or unverified values remain null, never 0
  • Versioned JSON and CSV outputs
  • Per-model history files
  • Dated full snapshots
  • Read-only static API
  • Suitable for calculators, dashboards, cost analysis, and AI FinOps tooling

The weekly freshness workflow checks source URLs and stale last_verified_at values. It does not guess, infer, or overwrite prices automatically.

Quick Start

Latest JSON
curl -L https://aicostbudget.github.io/ai-api-pricing-data/api/v1/prices.json
Latest CSV
curl -L https://aicostbudget.github.io/ai-api-pricing-data/api/v1/prices.csv
Single model record
curl -L https://aicostbudget.github.io/ai-api-pricing-data/api/v1/models/openai/gpt-4.1.json
Python
import json
import urllib.request

url = "https://aicostbudget.github.io/ai-api-pricing-data/api/v1/models/openai/gpt-4.1.json"
with urllib.request.urlopen(url) as response:
    model = json.load(response)

print(model["provider_id"], model["model_id"], model["pricing"]["input"])
JavaScript
const url = "https://aicostbudget.github.io/ai-api-pricing-data/api/v1/models/openai/gpt-4.1.json";

async function main() {
  const response = await fetch(url);
  const model = await response.json();

  console.log(model.provider_id, model.model_id, model.pricing.input);
}

main();

Developer utility: retry and fallback cost diagnostics

Run the repository's dependency-free Python example to estimate the cost of anonymized LLM task attempts while keeping first attempts, retries, and model fallbacks separate:

python examples/llm_cost_diagnostics.py examples/sample_llm_attempts.json

Expected output for the checked-in synthetic input and current checked-in Pricing V2 catalog:

LLM cost diagnostics
Input provenance: synthetic_example_not_production_measurement
Pricing catalog: data/pricing-v2-preview/generated/model-pricing.v2.json
Tasks: 3
Successful tasks: 2
Attempts: 5
Billed attempts: 5
Not-billed attempts: 0
First-attempt estimated cost (USD): 0.287500
Retry estimated cost (USD): 0.150000
Fallback estimated cost (USD): 0.300000
Total estimated cost (USD): 0.737500
Cost per successful task (USD): 0.368750

The example input is synthetic and is not a production measurement, provider invoice, or claimed success-rate benchmark. Replace it with anonymized attempt records from your own system. Each record must identify its task and attempt, classify the attempt as first_attempt, retry, or fallback, state whether the task attempt succeeded, and provide normalized usage by pricing component. usage.input must contain only uncached input tokens; cached input belongs in usage.cached_input so the two counts do not overlap.

The utility deliberately has a narrow billing scope:

  • It reads the checked-in Pricing V2 catalog and accepts only its verified, default-safe selected billing record.
  • It supports standard, short-context, global text pricing in USD per one million tokens for input, cached_input, and output components.
  • billing_status must be billed, not_billed, or unknown. An explicit not_billed attempt contributes zero; unknown stops the run instead of silently contributing zero.
  • Missing models or rates, conditional tiers, alternative processing modes, non-token units, unsupported usage components, and ambiguous billing conditions stop the run with an error.
  • Results are catalog-rate estimates for diagnostic comparison, not invoice reconciliation. Provider-specific taxes, contracts, credits, rounding, and unrecorded charges are outside this example's scope.

Use the interactive tools for scenario exploration:

Use Cases

  • Compare AI model prices
  • Estimate monthly AI API cost
  • Build LLM cost dashboards
  • Plan SaaS AI feature budgets
  • Track model pricing changes

Explore Pricing by Provider

ProviderPricing pageCoverage
OpenAIOpenAI API pricingGPT models, cached input, cache-write pricing, batch and alternative processing modes, and long-context tiers
AnthropicAnthropic API pricingClaude models, prompt caching, cache-write pricing, and batch pricing
Google GeminiGoogle Gemini API pricingGemini models, multimodal pricing, TTS, batch pricing, and cached input
xAIxAI API pricingGrok models, long-context tiers, processing-mode pricing, and speech/transcription pricing
DeepSeekDeepSeek API pricingDeepSeek chat and reasoning models, including cached-input pricing where available
Mistral AIMistral AI API pricingMistral model pricing with structured source and verification metadata
CohereCohere API pricingCohere model pricing and supported non-token services

Dataset Coverage

The dataset covers multiple AI providers and supports both token-based and non-token pricing structures.

Coverage includes:

  • Standard input and output token pricing
  • Cached input and cache-write pricing
  • Batch and alternative processing modes
  • Long-context, usage-tier, and conditional pricing
  • Multimodal and non-token pricing
  • TTS, speech, and transcription pricing
  • Model lifecycle, provenance, and verification metadata
  • Structured conditional pricing components

Fields

The CSV output uses the following fields:

FieldMeaning
provider_idStable provider identifier.
model_idStable model identifier within the provider.
display_nameHuman-readable model name.
model_familyModel family or grouping when available.
statusModel availability or lifecycle status.
currencyPricing currency.
unitPricing unit, such as per-token or per-million-token billing units.
inputInput token price for the listed unit.
outputOutput token price for the listed unit.
cached_inputCached input token price when available.
cache_writeCache write price when available.
batch_inputBatch input token price when available.
batch_outputBatch output token price when available.
official_source_urlProvider page or document URL used for source checking.
accessed_atDate when the source was accessed.
last_verified_atDate when the record was last verified.
effective_fromDate when the listed pricing became effective, if known.
notesAdditional context or caveats for the record.

API Reference

The static API is published through GitHub Pages:

  • /api/v1/prices.json
  • /api/v1/prices.csv
  • /api/v1/meta.json
  • /api/v1/providers/<provider>.json
  • /api/v1/models/<provider>/<model>.json

Unknown or unverified prices are represented as null, never 0.

The CSV output includes normalized pricing fields for provider, model, pricing unit, source URL, verification dates, and notes.

Historical Pricing

Per-model history files are stored under:

data/history/<provider>/<model>.jsonl

Dated full snapshots are stored under:

data/snapshots/<YYYY-MM-DD>/prices.json
data/snapshots/<YYYY-MM-DD>/prices.csv

The first pricing release of a UTC day uses the plain date. A later release on the same UTC day gets a sequence suffix (2026-10-21-2, 2026-10-21-3, …) so earlier snapshots are never rewritten. Snapshots order by date, then sequence; the date part is the event detected_at date.

Price Change Events

Canonical price change events are stored in:

data/price-change-events/events.jsonl

A price change event is different from a normal history verification row. History rows record source verification state for a model and may change when last_verified_at, official_source_url, or notes change. Price change events record verified scalar pricing semantics between two trusted snapshots and can also emit component_price_update when matching pricing_id + charge_id entries change amount while scalar prices remain unchanged. Component events preserve the component name, old and new decimal-string amounts, and condition. Component additions/removals are not treated as price launches because they may reflect coverage changes.

Baseline snapshots are not price changes. New snapshots, reordered files, source URL edits, status changes, or repeated verification dates must not create price change events when the prices are unchanged.

Date fields use separate meanings:

  • effective_from: provider-announced effective date only. It stays null when the provider did not publish one.
  • detected_at: the first snapshot date where the repository observed the change by comparing trusted snapshots.
  • verified_at: the date the new price was checked against an official provider source.
  • date_basis: one of provider_announced, official_changelog, first_observed, or unknown.

Preview events without writing:

python scripts\generate_price_change_events.py --before data\snapshots\2026-07-09\prices.json --after data\snapshots\2026-07-27\prices.json --dry-run

Generate the canonical JSONL projection:

python scripts\generate_price_change_events.py --before data\snapshots\2026-07-09\prices.json --after data\snapshots\2026-07-27\prices.json

The generator matches models by provider_id + model_id, compares only pricing semantics, writes stable sorted output, and merges by dedupe_key. The first version emits price_update, cached_price_added, and cached_price_removed; it does not emit pricing_added or pricing_removed because a model first appearing in a snapshot may be coverage expansion rather than an official pricing launch. The dedupe key is based on provider, model, old prices, new prices, unit, currency, and change type. It excludes verified_at, announcement_url, and notes so later metadata backfills update the same event instead of creating a duplicate.

Both source snapshots must already be tracked by Git before event generation. The generator fails closed rather than writing a canonical event that depends on an ignored, untracked, or local-only snapshot.

Manual backfills should edit the existing event with the same dedupe_key. Add effective_from only when an official provider announcement, official changelog, or pricing page explicitly gives the effective date. Add announcement_url only for an official URL; do not invent one.

Do not copy a fixed event count into documentation or product code. The validated records in data/price-change-events/events.jsonl are the authoritative current count.

Publication readiness is determined from the current event file: require at least 5 real price changes, at least 3 providers covered, an official source plus detected_at and verified_at for every event, explicit marking of unknown effective dates, and no inferred old prices. Passing these gates supports a recent verified price-changes feed; it does not by itself establish deep multi-year Pricing History coverage.

Methodology

Prices are accepted only from official provider pricing pages, official documentation, official APIs, or official announcements. Third-party calculators, SEO pages, Reddit posts, and competitor aggregators are not used as final price sources.

See METHODOLOGY.md.

Cite this dataset

For reproducible research, cite the frozen v1.1.0 release:

AICostBudget. AICostBudget AI API Pricing Dataset, v1.1.0 (snapshot 2026-09-30). https://doi.org/10.5281/zenodo.23087250.

The DOI identifies this fixed release, not the latest data. CITATION.cff provides its machine-readable citation metadata. The canonical live dataset continues to update; for current operational use, cite that URL with your access date. The export's generated_at and last_verified_at timestamps are separate from the access date. See the release process for projection and checksum rules.

Contributing

Contributions are welcome when they include official sources and preserve null for unknown values. See CONTRIBUTING.md.

License

Code is licensed under MIT in LICENSE-CODE. Data is licensed under Creative Commons Attribution 4.0 in LICENSE-DATA.

Disclaimer

AI API prices change frequently. Always verify official provider pricing pages before making production budget decisions.

This dataset is informational and may lag provider pricing changes. Provider names and trademarks belong to their respective owners. This project is not affiliated with, endorsed by, or sponsored by any listed provider.

الأسئلة الشائعة

ما هو AICostBudget AI API Pricing؟

Read-only source-linked AI API prices, comparisons, cost estimates, and price changes.

كيف أثبّت AICostBudget AI API Pricing؟

يعمل على جهازك. في Claude Code: claude mcp add aicostbudget-ai-api-pricing -- npx -y ai-api-pricing-mcp@0.1.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج AICostBudget AI API Pricing إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل AICostBudget AI API Pricing مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون AICostBudget AI API Pricing؟

ينشره aicostbudget. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.