Many people complain about expensive charge on realtime API, I also confused about tokenization calculation in API.
I got the first response message from realtime API: “Hi there! How can I assist you today?”
It says 20 output tokens.
"output_token_details": {
"text_tokens": 20,
"audio_tokens": 47
}
but it is 10 by this tool https://platform.openai.com/tokenizer.
They doubled it, and double charge us?
Attached is an event of “response.done” from realtime API
{
"type": "response.done",
"event_id": "****",
"response": {
"object": "realtime.response",
"id": "*****",
"status": "completed",
"status_details": null,
"output": [
{
"id": "*****",
"object": "realtime.item",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "audio",
"transcript": "Hi there! How can I assist you today?"
}
]
}
],
"usage": {
"total_tokens": 577,
"input_tokens": 510,
"output_tokens": 67,
"input_token_details": {
"cached_tokens": 0,
"text_tokens": 510,
"audio_tokens": 0
},
"output_token_details": {
"text_tokens": 20,
"audio_tokens": 47
}
}
}
}