API Documentation
Free REST API for LLM pricing data. No signup required for 30 requests/hour.
Quick Start
curl https://pricetoken.ai/api/v1/textOffline Cost Calculator
Calculate costs without any API call — works in browsers, Node.js, and edge runtimes.
import { calculateModelCost } from 'pricetoken';
const cost = calculateModelCost(
'claude-sonnet-4-6',
1_000_000, // 1M input tokens
100_000 // 100K output tokens
);
console.log(cost.totalCost); // $4.50Filter by Launch Date
Every model includes a launchDate field (API GA date). Use the after and before query params on /text and /text/cheapest to filter by date range.
# Models launched in 2025 or later
curl "https://pricetoken.ai/api/v1/text?after=2025-01-01"
# Models launched before 2025
curl "https://pricetoken.ai/api/v1/text?before=2025-01-01"
# Models launched in H1 2025
curl "https://pricetoken.ai/api/v1/text?after=2025-01-01&before=2025-07-01"
# Cheapest model launched since October 2025
curl "https://pricetoken.ai/api/v1/text/cheapest?after=2025-10-01"Endpoints
Token-based pricing for LLMs. Uses inputPerMTok and outputPerMTok (cost per million tokens).
/api/v1/textCurrent pricing for all models. Params: ?provider=anthropic¤cy=EUR&after=2025-01-01&before=2025-12-31
/api/v1/text/:modelIdSingle model pricing and metadata. Param: ?currency=EUR
/api/v1/text/historyHistorical pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/text/providersProvider list with model counts and cheapest prices.
/api/v1/text/compareSide-by-side comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/text/cheapestCheapest model overall or per provider. Params: ?provider=x¤cy=EUR&after=2025-01-01&before=2025-12-31
/api/v1/pricing/currenciesSupported currencies with exchange rates.
Per-image pricing for generation models. Uses costPerImage instead of per-token pricing.
/api/v1/imageCurrent pricing for all image models. Params: ?provider=openai¤cy=EUR
/api/v1/image/:modelIdSingle image model pricing. Param: ?currency=EUR
/api/v1/image/historyHistorical image pricing. Params: ?days=30&modelId=x&provider=y
/api/v1/image/providersImage provider list with model counts and cheapest prices.
/api/v1/image/compareSide-by-side image model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/image/cheapestCheapest image model overall or per provider. Params: ?provider=x¤cy=EUR
Per-minute pricing for video generation across Runway, Sora, Veo, Kling, and more. Uses costPerMinute instead of token pricing.
# All video models
curl https://pricetoken.ai/api/v1/video
# Single video model
curl https://pricetoken.ai/api/v1/video/runway-gen4-720p
# Cheapest video model
curl https://pricetoken.ai/api/v1/video/cheapest?provider=runway/api/v1/videoCurrent pricing for all video models. Params: ?provider=runway¤cy=EUR
/api/v1/video/:modelIdSingle video model pricing. Param: ?currency=EUR
/api/v1/video/historyHistorical video pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/video/providersVideo provider list with model counts and cheapest prices.
/api/v1/video/compareSide-by-side video model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/video/cheapestCheapest video model overall or per provider. Params: ?provider=x¤cy=EUR
Per-minute pricing for AI avatar and talking-head APIs. Uses costPerMinute with an additional avatarType field (standard, premium, translation, streaming).
# All avatar models
curl https://pricetoken.ai/api/v1/avatar
# Single avatar model
curl https://pricetoken.ai/api/v1/avatar/heygen-public-avatar-iii
# Cheapest avatar model
curl https://pricetoken.ai/api/v1/avatar/cheapest/api/v1/avatarCurrent pricing for all avatar models. Params: ?provider=heygen¤cy=EUR
/api/v1/avatar/:modelIdSingle avatar model pricing. Param: ?currency=EUR
/api/v1/avatar/historyHistorical avatar pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/avatar/providersAvatar provider list with model counts and cheapest prices.
/api/v1/avatar/compareSide-by-side avatar model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/avatar/cheapestCheapest avatar model overall or per provider. Params: ?provider=x¤cy=EUR
Per-character pricing for text-to-speech APIs. Uses costPerMChars (cost per million characters) with an additional voiceType field (standard, neural, wavenet, hd).
# All TTS models
curl https://pricetoken.ai/api/v1/tts
# Single TTS model
curl https://pricetoken.ai/api/v1/tts/openai-tts-1
# Cheapest TTS model
curl https://pricetoken.ai/api/v1/tts/cheapest/api/v1/ttsCurrent pricing for all TTS models. Params: ?provider=openai¤cy=EUR
/api/v1/tts/:modelIdSingle TTS model pricing. Param: ?currency=EUR
/api/v1/tts/historyHistorical TTS pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/tts/providersTTS provider list with model counts and cheapest prices.
/api/v1/tts/compareSide-by-side TTS model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/tts/cheapestCheapest TTS model overall or per provider. Params: ?provider=x¤cy=EUR
Per-minute pricing for speech-to-text APIs. Uses costPerMinute with an additional sttType field (batch, streaming, real-time).
# All STT models
curl https://pricetoken.ai/api/v1/stt
# Single STT model
curl https://pricetoken.ai/api/v1/stt/openai-whisper-1
# Cheapest STT model
curl https://pricetoken.ai/api/v1/stt/cheapest/api/v1/sttCurrent pricing for all STT models. Params: ?provider=openai¤cy=EUR
/api/v1/stt/:modelIdSingle STT model pricing. Param: ?currency=EUR
/api/v1/stt/historyHistorical STT pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/stt/providersSTT provider list with model counts and cheapest prices.
/api/v1/stt/compareSide-by-side STT model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/stt/cheapestCheapest STT model overall or per provider. Params: ?provider=x¤cy=EUR
Per-minute pricing for AI music generation APIs. Uses costPerMinute with additional fields for outputFormat, vocals, and official (marks unofficial third-party wrappers).
# All music models
curl https://pricetoken.ai/api/v1/music
# Single music model
curl https://pricetoken.ai/api/v1/music/elevenlabs-eleven-music
# Cheapest music model
curl https://pricetoken.ai/api/v1/music/cheapest/api/v1/musicCurrent pricing for all music models. Params: ?provider=elevenlabs¤cy=EUR
/api/v1/music/:modelIdSingle music model pricing. Param: ?currency=EUR
/api/v1/music/historyHistorical music pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/music/providersMusic provider list with model counts and cheapest prices.
/api/v1/music/compareSide-by-side music model comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/music/cheapestCheapest music model overall or per provider. Params: ?provider=x¤cy=EUR
Rate Limits
API keys are free — no charges, ever. Key holders get higher rate limits.
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
API Keys
API keys are completely free — there are no charges, no credit card required, and no usage fees. Keys simply unlock higher rate limits (500 requests/hour instead of 30).
Key Format
All keys use the pt_ prefix:
pt_live_abc123def456...
Authentication
Pass your API key via the Authorization header using Bearer token format:
curl https://pricetoken.ai/api/v1/text \
-H "Authorization: Bearer pt_live_YOUR_KEY"Get an API Key
Self-service signup coming soon
In the meantime, you can request a free API key by opening a GitHub issue or emailing [email protected].
Keys are free — no credit card, no trial period, no catches.
Confidence Scoring
Every model includes a Bayesian confidence score (0–100) that reflects how much you can trust the pricing data. The score is computed at query time so it naturally decays as data ages.
How it works
We use log-odds Bayesian updating: start with a prior based on data source, then update with evidence from agent consensus, data age, and price stability.
P(correct) = sigmoid(log_prior + LLR_agents + LLR_age + LLR_stability)
Response fields
confidenceScore0–100 numeric scoreconfidenceLevel"high" (≥80), "medium" (50–79), "low" (<50)freshness.lastVerifiedISO 8601 timestamp of last verificationfreshness.ageHoursHours since last verificationfreshness.staletrue if data is older than 48 hoursResponse Format
{
"data": [
{
"modelId": "claude-sonnet-4-6",
"provider": "anthropic",
"displayName": "Claude Sonnet 4.6",
"inputPerMTok": 3,
"outputPerMTok": 15,
"contextWindow": 200000,
"confidenceScore": 97,
"confidenceLevel": "high",
"freshness": {
"lastVerified": "2026-03-05T08:00:00Z",
"ageHours": 4,
"stale": false
},
"launchDate": "2026-02-17",
...
}
],
"meta": {
"timestamp": "2026-03-05T12:00:00Z",
"cached": false,
"currency": "EUR", // only with ?currency
"exchangeRate": 0.92 // only with ?currency
}
}