Google Gemini AI API Call 2.0 Image Generation

Anybody knows how to configure the Make Api Call option in the Gemini API module to generate images? I tried this way, i get a 404 error

2 Likes

Same problem for me also, how to use Gemini api for image generation

1 Like

Your URL request is wrong, you forgot to include :generateContent
/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent

2 Likes

Good catch. Still erroring though. [404] models/gemini-2.0-flash-preview-image-generation is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.

1 Like

According to the docs Image generation | Gemini API | Google AI for Developers These are the suported versions for image generation:

  • For Gemini, use Gemini 2.0 Flash Preview Image Generation.
  • For Imagen, use Imagen 3. Note that this model is only available on the Paid tier.

And it works for me


Maybe your API key is not allowed to make images?
Replace “GEMINI_API_KEY” with your ApiKey and test it
copy the curl code from here https://aistudio.google.com/app/apikey

1 Like