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

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

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

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.

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

An an alternative, you could use the Google Vertex AI (Gemini) app.

This includes a specific module for Generate an Image, with Gemini 2.0 Flash and Imagen 3 models available.

It uses a slightly different underlying Google API. Authentication is via OAuth (username and password) rather than API Key and so provides better security.