Unexpected token length for vision

The input token consumption by gpt-4o-mini is to ensure that there is no “cheap vision” AI model. In fact, gpt-4o-mini costs twice as much for image input as simply gpt-4o.

The input token cost of an image is multiplied by 33.33x on gpt-4o-mini.

85 tokens of a “detail:low” image sent to gpt-4o becomes 2833 billed by gpt-4o-mini. Then your 6 tile + base image you are sending at detail:high, with 13x the tile and token cost of detail:low becomes the billed token cost you see.

It is not more expensive to use base64. What you should do is use the better quality model at lower image cost, and the whole API call might be cheaper too.