Here is how i use according to documentation: https://ai.google.dev/gemini-api/docs/openai#generate-image
curl "https://generativelanguage.googleapis.com/v1beta/openai/images/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 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,
}'
Error:
{
“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”
}
}
I list model, and the model is found:
“id”: “models/gemini-2.0-flash-exp-image-generation”,
“id”: “models/gemini-2.5-flash-image”,
“id”: “models/gemini-3-pro-image-preview”,
“id”: “models/imagen-4.0-generate-preview-06-06”,
“id”: “models/imagen-4.0-ultra-generate-preview-06-06”,
“id”: “models/imagen-4.0-generate-001”,
“id”: “models/imagen-4.0-ultra-generate-001”,
“id”: “models/imagen-4.0-fast-generate-001”,
Is the documentation wrong or i have to manually enable gemini-2.5-flash-image somewhere in my google AI account?
Note: I need use Open AI Mode, and i have to use Open AI endpoints.