TokenCalcAI
Prompt RouterCalculatorCompare AIGuidesFree CoursesAI NewsCommunity
Home/LLM Price Index/API Docs

Base URL: https://tokencalcai.com · Zero Auth · CORS Enabled

TokenCalc AI Public REST API Docs

Self-serve JSON and SVG endpoints powering pricing alerts, CI token budget gates, and GitHub README cost badges. No API key, account, or SDK required.

API Quickstart

How do I query TokenCalc AI pricing and latency programmatically?

Send an unauthenticated HTTP GET to https://tokencalcai.com/api/price-index for all catalog model rates (USD per 1M tokens), GET /api/status for 60-second Anthropic/OpenAI/Gemini/Cursor latency probes, or GET /api/badge?format=json for live monthly workload cost calculations.

Expand the details
  • No Auth Needed: Zero API keys or headers required; GET JSON routes set Access-Control-Allow-Origin: *.
  • Price Catalog: GET /api/price-index returns active and retired models with reviewedThrough audit dates and source URLs.
  • Status Radar: GET /api/status combines 60s server probes with crowdsourced fast/slow/down counts.
  • Official CLI: Run npx tokencalcai status, price, overpaying, quota, or check from Node >= 18.
LLM Price Index TableLive AI StatusREADME Badges

Endpoints Overview

MethodPathAuth / Rate LimitCacheDescription
GET/api/price-indexNone (Public, CORS *)s-maxage=3600Full active + retired LLM catalog pricing snapshot in USD per 1M tokens.
GET/api/statusNone (Public, CORS *)no-store (60s probe TTL)Live Anthropic/OpenAI/Gemini/Cursor latency probes + crowdsourced vote totals.
POST/api/statusNone (16 req / 5m IP limit)no-storeSubmit a fast / slow / down report for claude, chatgpt, gemini, or cursor.
GET/api/badgeNone (Public)86400s (SVG) / 3600s (JSON)Calculate workload cost & return dynamic SVG shield, Markdown snippet, or JSON.
GET/api/badge/[model]None (Public)86400sLightweight SVG price pill showing current input $/1M tokens for README embeds.

1. GET /api/price-index — Catalog Model Rates

Returns every active and retired LLM sorted by ascending inputCostPer1M. No query parameters are required.

curl -s https://tokencalcai.com/api/price-index | jq '.models[0]'
{
  "name": "TokenCalc AI LLM Price Index",
  "reviewedThrough": "2026-11-20",
  "counts": { "total": 35, "active": 24, "retired": 11 },
  "models": [
    {
      "id": "gpt-6-luna",
      "provider": "OpenAI",
      "currency": "USD",
      "unit": "per_1m_tokens",
      "inputCostPer1M": 0.1,
      "outputCostPer1M": 0.5,
      "cacheReadCostPer1M": 0.01,
      "contextWindow": 1050000
    }
  ]
}

2. GET & POST /api/status — Live Provider Latency & Outage Radar

GET /api/status returns cached 60-second upstream status probes plus crowdsourced developer vote counts for claude, chatgpt, gemini, and cursor. POST /api/status accepts {"platform":"claude","vote":"fast|slow|down"} (16 req / 5 min per IP).

curl -s https://tokencalcai.com/api/status | jq '.probes.claude'

3. GET /api/badge — Dynamic Cost & README SVG Endpoint

Simulates daily, monthly, or annual spend across any catalog model with caching and reasoning multipliers. Set format=json for machine-readable cost outputs or omit format for an embeddable SVG badge. For a quick static price pill, call GET /api/badge/claude-sonnet-5-5.

Query ParamTypeDefaultDescription
modelstringdeepseek-flashCatalog model ID (e.g. claude-sonnet-5-5, gpt-6-1-sol, gemini-4-neon).
inputnumber0Daily input tokens (0 to 1,000,000,000).
outputnumber0Daily output tokens (0 to 1,000,000,000).
runsnumber0Daily requests (used for model request context).
cachenumber0Prompt cache-hit rate percentage (0 to 100).
reasoningnumber0Reasoning token output multiplier (0 to 20).
seatsnumber1Team seats multiplier (1 to 100,000).
timeframeenummonthlyOne of daily, monthly, or annual.
colorenumindigoBadge accent: indigo, emerald, amber, purple, or zinc.
formatenumsvgResponse type: svg (default), json (structured USD breakdown), or md.
curl -s "https://tokencalcai.com/api/badge?model=claude-sonnet-5-5&input=250000&output=50000&cache=70&format=json"

API Docs FAQ

4 short answers — tap a question to expand.

Do I need an API key to query /api/price-index, /api/status, or /api/badge?

No. All three read endpoints are public, unauthenticated REST endpoints with permissive CORS headers (Access-Control-Allow-Origin: * on JSON endpoints). Only POST /api/status enforces an IP rate limit of 16 submissions per 5 minutes.

What currency and unit does GET /api/price-index return?

Every model entry returns USD per 1,000,000 tokens (currency: "USD", unit: "per_1m_tokens") across inputCostPer1M, outputCostPer1M, and optional cacheReadCostPer1M, alongside pricingSourceUrl and pricingCheckedAt metadata.

How fresh are the latency probes on GET /api/status?

Server-side status probes for Claude, ChatGPT, Gemini, and Cursor are cached for 60 seconds (2.5-second upstream timeout) and paired with live Upstash KV crowdsourced votes on every GET request.

Can I consume TokenCalc AI prices and cost gates from CI/CD?

Yes. Run npx --yes tokencalcai@latest check --model claude-sonnet-5-5 --in 25000 --out 1200 --max-usd 0.15 in GitHub Actions or call GET /api/badge?format=json&model=claude-sonnet-5-5&input=25000&output=1200.

← LLM Price Index·GitHub Badge Generator →·MCP vs CLI Calculator →·Catalog Verification →
TokenCalc AI

Simple AI cost picker, model comparisons, and free prompt tools.

Tools

  • Prompt Router
  • Calculator
  • Overpaying?
  • Tokenizer
  • Prompt Shortener
  • GitHub Badges
  • Chrome Extension
  • API Docs
  • All Tools
  • Usage Log

Learn

  • Guides
  • Articles
  • Free Courses
  • AI News

Research

  • Compare AI
  • Side-by-Side
  • Free APIs
  • Leaderboard
  • Local AI
  • AI Status
  • Speed Race
  • MCP vs CLI

Company

  • About
  • Contact
  • Feedback
  • How It Works
  • Privacy
  • Terms

© 2026 TokenCalc AI. Independent AI pricing & token economics.

RunPod GPUs↗Vast.ai GPUs↗DigitalOcean Referral Badge
HomeCalculatorModelsTools