HeadlinesBriefing favicon HeadlinesBriefing.com

Why Same TypeScript Costs 73% More on Claude

Hacker News •
×

AI model pricing pages show a single "dollars per million tokens" figure, but the token count varies by tokenizer. The same TypeScript file is 681 tokens on GPT‑5.x and 1,178 tokens on Claude's newest tokenizer, a 1.73× increase and 31% higher than Claude's previous tokenizer. This hidden rise hits code‑heavy workloads hardest; English prose only shows a ~1.4× gap.

Two hidden cost layers exist: the token count (set by each model’s tokenizer) and the per‑token price. Anthropic’s Claude Opus 4.8 uses a new tokenizer that creates 29‑32% more tokens than Opus 4.6 for the same bytes, effectively raising costs despite unchanged rate cards. Cross‑vendor, Claude’s tokenizer yields 73% more tokens than GPT’s o200k tokenizer on TypeScript.

The study measured 16 real fixtures (code, prose, JSON, Chinese text) using each provider’s official token‑count endpoints and verified billed usage. Results confirm the token inflation is real and appears on invoices, not pricing pages. The intro pricing for Claude Sonnet 5 masks this inflation temporarily, but once the promotional period ends, costs rise by roughly 32% at the same sticker price.