Token Discrepancy When Using Images

Token Usage Discrepancy Between API Response and Activity Display.
api usage:

{"prompt_tokens":2870,"completion_tokens":215,"total_tokens":3085,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}}

usage/activity: 52369 token
Why Such a Large Discrepancy? I’m Using Prompts + Images for Content Analysis.

1 Like

I mean an image can’t have only 3085 token for sure… so the 52k looks right to me… it looks like it only shows the token beside the image in the usage block…

Actually I would even say 52k is pretty low for an image.

You should try to display the asci code of a base64 encoded image and then devide the number of characters in it roughly by let’s say 3 or 4 - which should come out to the right amount of tokens the image would consume…

1 Like