Using generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent API. This message referencing a public URL for a jpeg gets a result code of 400:
{
"model": "gemini-2.0-flash",
"contents": [
{
"parts": [
{
"image_url": {
"url": "https://scx1.b-cdn.net/csz/news/800a/2024/clouds.jpg",
"mime_type": "image/jpeg"
}
},
{
"text": "What is in this image?"
}
]
}
]
}
Using the inline data base64 encoded approach works fine, so my API key is fine. Does anyone have a solution to this API image_url content part issue?
In consulting google gemini on the issue, gemini concluded:
"The fact that the Base64 encoded image worked while the image_url consistently fails with a 400 error strongly indicates that the issue lies specifically in how the gemini-2.0-flash model (or the underlying API infrastructure it uses) is handling or fetching images via URL in your requests."
Perhaps this should go to cloud support but my tier doesn't have access for technical issues.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |