Image processing: Prompt vs API

Hi there! For some reason it seems that recognizing/processing images via api differs from the prompt-way. I sent an image via api using the gemini api sdk, and asked the model, to tell me what number can he see. He was hallucinating all the time and was not able to recognize the number. However, when I sent the same image to the same model using the prompt, he recognized several times correctly. Do you have any idea why is that? I used gemini-2.0-flash-thinking-exp-01-21.

Hi @Erik_Kovacs , Welcome to the forum.

You mean when you upload images via AIStudio, it is recognizing correctly?

Sorry, yes, when uploading via AIStudio vs uploading via API.

Could you share the image file, if possible?

Sure! The price channel was the image for testing. The others are how a I tested. Was asking the same question.

1 Like

I tested the same query you shared in the API and ran it multiple times. The response seems consistent, and it gave the same result as in AIStudio.
I am not sure why it gave a different response for you. By any chance, do you have any other queries that failed in the API but worked in AIStudio?