Will gemini-2.0-flash-preview-image-generation be available on OpenAI compatible API v1main?

I am getting the following error:

models/gemini-2.0-flash-preview-image-generation is not found for API version v1main, or is not supported for predict. Call ListModels to see the list of available models and their supported methods

gemini-2.0-flash-exp-image-generation is also not available, but imagen-3.0-generate-002 is.

Please let me know whether we can expect this on the OpenAI compatible API at

https://generativelanguage.googleapis.com/v1beta/openai/

Hi @ktc, Thanks for reporting this. while using 2.0 flash preview image generation model to generate images with open ai library has encountered the same error. will bring this to the engineering team attention. Thank You.

Further insights from looking at the ListModels response and the error message about predict:

  1. I believe gemini-2.0-flash-preview-image-generation requires me to call generateContent via the client.chat call whereas imagen-3.0-generate-002 uses predict via the client.images.generate call.

  2. Using the former with the model works, but there’s no way to specify the response modality to return images in the OpenAI-compatible API, with the following error messages:

{"error"=>{"code"=>400, "message"=>"Invalid JSON payload received. Unknown name \"generationConfig\": Cannot find field.", "status"=>"INVALID_ARGUMENT", "details"=>[{"@type"=>"type.googleapis.com/google.rpc.BadRequest", "fieldViolations"=>[{"description"=>"Invalid JSON payload received. Unknown name \"generationConfig\": Cannot find field."}]}]}}

{"error"=>{"code"=>400, "message"=>"Invalid JSON payload received. Unknown name \"generation_config\": Cannot find field.", "status"=>"INVALID_ARGUMENT", "details"=>[{"@type"=>"type.googleapis.com/google.rpc.BadRequest", "fieldViolations"=>[{"description"=>"Invalid JSON payload received. Unknown name \"generation_config\": Cannot find field."}]}]}}