# Send an Image as a Prompt to Gemini using the API

**URL:** <https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824>\
**Category:** Questions about Thunkable X\
**Created:** [August 9, 2024, 3:24pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824 "2024-08-09T15:24:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![varunkadapatti](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@varunkadapatti](https://community.thunkable.com/u/varunkadapatti)\
**Post date:** [August 9, 2024, 3:24pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/1 "2024-08-09T15:24:38Z")

</div>

I have watched the very well crafted tutorial on “How To Use Gemini API” and it was worked extremely well for text inputs.

However, now I want to upload images to the Gemini API. How do i achieve this?  
I am not sure how to send an image to the API and then get the required output because the prompt should be IMAGE + TEXT together.

Can someone please advise me on this?

Thank you.  
Regards,  
Varun Kadapatti

---

<div class="post-metadata">

**Author:** ![varunkadapatti](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@varunkadapatti](https://community.thunkable.com/u/varunkadapatti)\
**Post date:** [August 12, 2024, 2:05pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/2 "2024-08-12T14:05:45Z")

</div>

Can someone please guide me as to how to achieve this if possible?  
Sending a link for the picture does not work…

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [August 12, 2024, 2:21pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/3 "2024-08-12T14:21:16Z")

</div>

Could you link the documentation from Google for uploading images on Gemini?

---

<div class="post-metadata">

**Author:** ![varunkadapatti](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@varunkadapatti](https://community.thunkable.com/u/varunkadapatti)\
**Post date:** [August 15, 2024, 10:41am UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/4 "2024-08-15T10:41:58Z")

</div>

Yes! Here are the links to the same.  
[File prompting strategies | Gemini API | Google AI for Developers](https://ai.google.dev/gemini-api/docs/file-prompting-strategies)

[Explore vision capabilities with the Gemini API | Google AI for Developers](https://ai.google.dev/gemini-api/docs/vision?lang=python)

Thank you!

---

<div class="post-metadata">

**Author:** ![varunkadapatti](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@varunkadapatti](https://community.thunkable.com/u/varunkadapatti)\
**Post date:** [August 21, 2024, 1:19pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/5 "2024-08-21T13:19:50Z")

</div>

Hello, I’ve made few advancements in trying to prompt Gemini with images using the Gemini API.  
This is the JSON code I have used in the Web API’s Body.  
However, it always returns a “null” value for some reason as the output.  
After investigating in Google Cloud Console, it seems that the Gemini API does not receive the request at all.  
I have ensured that the API key is up-to-date and it is functioning in my other use cases.  
Please can someone guide me on this.  
Thank you.

WEB API BODY:  
{  
“contents”: [  
{  
“role”: “user”,  
“parts”: [  
{  
“fileData”: {  
“fileUri”: “[Imgur: The magic of the Internet](https://i.imgur.com/sLtbEFf.jpeg)”,  
“mimeType”: “image/jpeg”  
}  
},  
{  
“text”: “Please solve this mathematics question”  
}  
]  
}  
],  
“generationConfig”: {  
“temperature”: 1,  
“topK”: 64,  
“topP”: 0.95,  
“maxOutputTokens”: 8192,  
“responseMimeType”: “text/plain”  
}  
}

**For context I am making an AI Math question solver**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [November 19, 2024, 1:19pm UTC](https://community.thunkable.com/t/send-an-image-as-a-prompt-to-gemini-using-the-api/3133824/6 "2024-11-19T13:19:54Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
