Realtime API cost mismatch between the bill and the calculated cost

Hello everybody,

I’ve realized OpenAI has billed me around twice as cheap as the cost I calculated based on number usage.

I’m not sure if this is a bug or if I missed something in my project dashboard.

For the calculation, what I do is to accumulate all the tokens response.done, namely the following information:

{
  "usage": {
    "total_tokens": 9492,
    "input_tokens": 8223,
    "output_tokens": 1269,
    "input_token_details": {
      "text_tokens": 5378,
      "audio_tokens": 2845,
      "cached_tokens": 8192,
      "cached_tokens_details": {
        "text_tokens": 5376,
        "audio_tokens": 2816
      }
    },
    "output_token_details": {
      "text_tokens": 250,
      "audio_tokens": 1019
    }
  }
}

and then to calculate at the end of the conversation the total cost using the given pricing.

To see the cost that was billed, I go to the usage tab on my dashboard:

I tried comparing all the calls that I made to the gpt-4o-mini-realtime-preview-2024-12-17 model over the last three days. The details are as follows (for all calls combined of the day):

  • Jan 27th: Calculated: $0.86, Billed: $0.41.
  • Jan 26th: Calculated: $0.19, Billed: $0.12.
  • Jan 25th: Calculated: $1.23, Billed: $0.50.

What did I do wrong please? Thank you very much in advance for your help!