Open AI Pricing JSON API & Machine-Readable Endpoints
All endpoints below are served directly from Cloudflare’s global edge with CORS enabled (Access-Control-Allow-Origin: *), 1-hour edge caching, and automated sanity-check protection.
GET /api/prices.json
368 LLM Models
Direct official + OpenRouter pricing, cache read/write, batch rates, context limits.
GET /api/multimodal.json
318 Multimodal APIs
Image gen, video per-second, STT, TTS, and embedding unit pricing.
GET /api/gpus.json
12 GPU SKUs
RunPod, Vast.ai, Lambda, and DigitalOcean hourly pricing + vLLM throughput presets.
Quick Usage Examples
cURL + jq
curl -sS https://ai-cost-calc-preview.pages.dev/api/prices.json | jq '.models[:5] | map({id, pricingBasis, effective})' Node.js / TypeScript
const res = await fetch('https://ai-cost-calc-preview.pages.dev/api/prices.json');
const { verifiedAt, models } = await res.json();
const claude = models.find((m) => m.id.includes('claude-sonnet'));
console.log(verifiedAt, claude?.effective);