This LLM cost function looks right. Can you spot the bug?
OpenAI's reasoning models bill you for thinking you never see. So it seems careful to add that thinking to your cost tracking, like this: from decimal import Decimal # Made-up prices, in USD per million tokens. INPUT_RATE = Decimal ( " 0.50 " ) OUTPUT_RATE = Decimal ( " 2.00 " ) def estimate_cost (…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-11-09 20:39 · DEV Community — AI
This LLM cost function looks right. Can you spot the bug?