How to calculate Image and Audio token cost for gpt4o using tiktoken

Hi, how do you use tiktoken to calculate token usage for audio and image token usage for Gpt4o. Could find any reasonable documentation on it

The pricing for images is based on the detail option and the size and tiling.

A little calculator can be found on the OpenAI pricing page.

A low detail image starts at 85 tokens, with an image 2048x768 (which maximizes the detail:high cost) coming in at 1445 tokens.

gpt-4o uses a different image tokenizer (and you don’t get to see how it works), which shaves a few tokens off the price, but acts less predictably through the range of tile resolutions.

The model’s use of multimodal audio and availability by API is still unpublished.

1 Like

This is the pricing page that @_j was talking about. Check it out and input your values to get an estimate. Cheers !

https://openai.com/api/pricing/

1 Like

Thanks for you prompt response. I have an AI Assistant App and I added the multimodal audio feature on it that was why i was asking if there was an update on how to calculate token usage using tiktoken for it. Thanks anyway