API Documentation
Free REST API for LLM pricing data. No signup required for 30 requests/hour.
Quick Start
curl https://pricetoken.ai/api/v1/pricingOffline 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.50Endpoints
/api/v1/pricingCurrent pricing for all models. Params: ?provider=anthropic¤cy=EUR
/api/v1/pricing/:modelIdSingle model pricing and metadata. Param: ?currency=EUR
/api/v1/pricing/historyHistorical pricing data. Params: ?days=30&modelId=x&provider=y
/api/v1/pricing/providersProvider list with model counts and cheapest prices.
/api/v1/pricing/compareSide-by-side comparison. Params: ?models=a,b,c (max 10)¤cy=EUR
/api/v1/pricing/cheapestCheapest model overall or per provider. Params: ?provider=x¤cy=EUR
/api/v1/pricing/currenciesSupported currencies with exchange rates.
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/pricing \
-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.
Response Format
{
"data": [...],
"meta": {
"timestamp": "2026-03-03T12:00:00Z",
"cached": false,
"currency": "EUR", // only with ?currency
"exchangeRate": 0.92 // only with ?currency
}
}