Pricing precision (for sub cent amounts)

The pricing page states the price for the 8k context of GPT-4 will be $0.03 / 1K input tokens + $0.06 / 1K output tokens.

I need to know how ChatGPT will handle sub cent amounts, but I can’t find any info on that.

As an extreme example let’s assume an API call of 160 input tokens + 160 output tokens . The math would be: 160 / 1000 * 0,.03$ + 160 / 1000 * 0.06$ = 0.0144$

If I process this API call a 100,000 times (what I intend to do) the outcome very much depends on how OpenAI handles these sub cent amounts:

  • rounding down (to 1 cent): 1,000 Dollars.
  • no rounding behind the scenes: 1,440 Dollars
  • rounding up (to 2 cents): 2,000 Dollars.

That’s quite a difference.

Which one is it?

Welcome to the developer forum!

The tokens are rolled over until 1000 have been used in either direction, at that point you are charged for the applicable rate. These are then either removed from your credit balance or added and then billed at the end of the billing cycle assuming the amount is greater than the minimum viable billing amount, which I think is currently at $0.50, but may have changed in the recent account and billing update to include credit pre pay accounts.

1 Like

Thanx Foxabilo, got it.

And yes, it’s the in fact the 2nd case, I was able to confirm that with my yesterday Usage Breakdown.