Base URL: https://tokencalcai.com · Zero Auth · CORS Enabled
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.
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.
| Method | Path | Auth / Rate Limit | Cache | Description |
|---|---|---|---|---|
| GET | /api/price-index | None (Public, CORS *) | s-maxage=3600 | Full active + retired LLM catalog pricing snapshot in USD per 1M tokens. |
| GET | /api/status | None (Public, CORS *) | no-store (60s probe TTL) | Live Anthropic/OpenAI/Gemini/Cursor latency probes + crowdsourced vote totals. |
| POST | /api/status | None (16 req / 5m IP limit) | no-store | Submit a fast / slow / down report for claude, chatgpt, gemini, or cursor. |
| GET | /api/badge | None (Public) | 86400s (SVG) / 3600s (JSON) | Calculate workload cost & return dynamic SVG shield, Markdown snippet, or JSON. |
| GET | /api/badge/[model] | None (Public) | 86400s | Lightweight SVG price pill showing current input $/1M tokens for README embeds. |
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
}
]
}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'
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 Param | Type | Default | Description |
|---|---|---|---|
| model | string | deepseek-flash | Catalog model ID (e.g. claude-sonnet-5-5, gpt-6-1-sol, gemini-4-neon). |
| input | number | 0 | Daily input tokens (0 to 1,000,000,000). |
| output | number | 0 | Daily output tokens (0 to 1,000,000,000). |
| runs | number | 0 | Daily requests (used for model request context). |
| cache | number | 0 | Prompt cache-hit rate percentage (0 to 100). |
| reasoning | number | 0 | Reasoning token output multiplier (0 to 20). |
| seats | number | 1 | Team seats multiplier (1 to 100,000). |
| timeframe | enum | monthly | One of daily, monthly, or annual. |
| color | enum | indigo | Badge accent: indigo, emerald, amber, purple, or zinc. |
| format | enum | svg | Response 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"
4 short answers — tap a question to expand.
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.
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.
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.
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.