Using curl to generate images through openAI-compatible mode calls shows 404

I used the following curl command:

curl --location --request POST 'https://generativelanguage.googleapis.com/v1beta/openai/images/generations' \
--header 'Authorization: Bearer $api_key' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: generativelanguage.googleapis.com' \
--header 'Connection: keep-alive' \
--data-raw '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "a portrait of a sheepadoodle wearing a cape",
    "response_format": "b64_json",
    "n": 1,
    "size": "1376x768"
}'

Received the following response:

{
  "error": {
    "code": 404,
    "message": "models/gemini-3-pro-image-preview 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.",
    "status": "NOT_FOUND"
  }
}

I accessed the model list through /v1beta/openai/models and found gemini-3-pro-image-preview included. I also tried other models like gemini-2.5-flash-image-preview, but encountered the same error. Could you please explain what might be causing this issue?

Also, I successfully called it using the URL https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent, but I need to use OpenAI-compatible methods.

Hey! The team is on it, we will get a Nano Banana example added to the docs, might take a few days because of the Holidays but stay tuned.

Hi @Logan_Kilpatrick , any updates on the Nano Banana example or OpenAI-compatible support?

I run into similar issues: Gemini-2.5-flash-image documented in open ai mode but not really supported?

Is the documentation incorrect or my account setting incorrect, really confusing: https://ai.google.dev/gemini-api/docs/openai#generate-image

if the Gemini-2.5-flash-image not really supported in open ai endpoint, why add to documentation in advance?