LLM pricing is 100x harder than you think

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

LLM cost attribution is far more complex than maintaining a simple JSON pricing file. Six key patterns break accurate cost tracking: thinking/reasoning tokens that are billed but invisible in responses, asymmetric cache pricing across providers, context-length-based pricing tiers that silently change rates, same models priced differently across providers with different identifier formats, non-token billing for images/video/audio, and constantly expanding billing dimensions. Portkey has open-sourced a model pricing database covering 3,500+ models across 50+ providers, along with an AI gateway that normalizes provider responses into a unified cost structure at the routing layer. They also built a Claude-powered agent that keeps pricing data current by scraping provider docs and opening PRs with updates, costing ~$2–3 per provider run.

8m read timeFrom portkey.ai
Post cover image
Table of contents
The 6 patterns that break pricingWhy It MattersHow Portkey's Gateway handles thisHow we keep 3,500+ models accuratePricing complexity isn't slowing down

Sort: