How does gpt-4o-mini-tts calculate tokens?

I’m generating tts using gpt-4o-mini-tts. It works via the Playground, but I get a “tokens is over the maximum input limit of 2000 tokens” error when I make the call via the API. I’d like to better understand my token count before calling the API.

I’ve seen tiktokenizer, but I only see ‘gpt-4o’ as an option. its not clear if the token count calculated for ‘gpt-4o’ will be the same as ‘gpt-4o-mini-tts’.

Is there a way to calculate token count for gpt-4o-mini-tts?

1 Like

I also need an answer to this. If you ask chatgpt itself, it says only input tokens are counted. But the model page puts a price on output tokens of $12/1M. And the API doesn’t return any usage count. The dashboard shows tts model text input and audio output in the “spend categories” tab but no details about how it derives those figures