`/v1beta/openai/images/generations` only works for some image models

,

/v1beta/openai/images/generations works for some image models but returns 404 for others, although GET /v1beta/models lists all of them.

Works: gemini-2.5-flash-image, gemini-3-pro-image-preview

Fails: gemini-3-pro-image, gemini-3.1-flash-image, gemini-3.1-flash-image-preview, gemini-3.1-flash-lite-image

curl -s -X POST 'https://generativelanguage.googleapis.com/v1beta/openai/images/generations' \
  -H "Authorization: Bearer $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gemini-3.1-flash-image",
    "prompt": "a small red circle on white",
    "response_format": "b64_json",
    "n": 1
  }'
{
  "error": {
    "code": 404,
    "message": "models/gemini-3.1-flash-image is not found for API version v1main, or is not supported for predict. Call ModelService.ListModels to see the list of available models and their supported methods.",
    "status": "NOT_FOUND"
  }
}

Swapping gemini-3.1-flash-image for gemini-2.5-flash-image in the same request returns 200.

1 Like