Docs say gemini-2.5-flash-image supports OpenAI endpoint, but curl returns 404

Hi everyone,

I attempted to generate an image using the OpenAI-compatible endpoint, exactly as described in the official Gemini API documentation: https://ai.google.dev/gemini-api/docs/openai?hl=zh-cn#generate-image.

However, the API returned a 404 error indicating that the model is not supported.

Steps to reproduce: Here is the exact curl command I am using to call the endpoint:

Bash

curl "https://generativelanguage.googleapis.com/v1beta/openai/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_GEMINI_API_KEY" \
  -d '{
        "model": "gemini-2.5-flash-image",
        "prompt": "a portrait of a sheepadoodle wearing a cape",
        "response_format": "b64_json",
        "n": 1
      }'

Actual Output (Error):

JSON

{
    "error": {
        "code": 404,
        "message": "models/gemini-2.5-flash-image 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"
    }
}

Could you please clarify if this is a known bug in the compatibility layer or if the documentation is currently out of sync with the backend? If it is a bug, is there an ETA for when it will be fixed?

Thank you!