Is the cost of transferring images through base64 and URL the same?

For a picture, I calculate the pixels to be 1900*1900 / / 223KB.

  1. The cost of using URL to transfer is US$0.003825, by gpt price. But I have not successfully transferred to GPT. So there’s no way to know the actual cost at this time.
  2. I have used base64 encoding for transmission and consumed more than 100,000 tokens.

Can someone tell me, does both transfer methods cost the same?

Do you have a screenshot of 100,000 tokens consumed due to base64 encoding?

Sorry, I uploaded it a few days ago. Records in PYcharm are not retained. But I have a situation of API consumption. I spent nearly $5 that day. Since I’m a beginner, I had GPT return records that consumed a tonken of proficiency.

on 19 Jun, when I first upload the file, it prompts me for more than a single transfer token. So I divided the base64 encoding into about 30 parts for transmission. The base64 encoding of an image is divided into 30 parts.

Make sure you did not send the base64-encoded string as-is as a user message.

This is what happens when a user sends a base64 encoded image as text rather than as an image URL.

There have been a few reports of this the last few weeks.

1 Like

You are indeed an expert. That’s what I do.
Please tell me what is the correct way to do this?

That’s what I do.
I have never learned any programming , so I wrote the codes with GPT guidance. Although I made this mistake, I still want to say that GPT is a great project.

I am not an expert, but…

You can call it correctly by replacing image_path in the code shown below with the path to your local image and api_key with your actual API key.

really thanks. Done it with base64 .and token takes about 3K which upload a2152*3029 PNG .

thanks again!

1 Like