/v1beta/openai/chat/completions is broken with image generation models (e.g. Nano Banana 2)

,

/v1beta/openai/chat/completions OpenAI compatibility surface is currently broken for image models e.g. gemini-3.1-flash-image. Generation seems to be successful internally but API fails to return the jpeg.

curl -s -X POST '``https://generativelanguage.googleapis.com/v1beta/openai/chat/completions``' \
-H "Authorization: Bearer $INITIAL_GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-3.1-flash-image",
"messages": [{"role": "user", "content": "Draw a small red circle on white."}],
"max_tokens": 1024
}'

[{
"error": {
"code": 400,
"message": "Unhandled generated data mime type: image/jpeg",
"status": "INVALID_ARGUMENT"
}
}

The v1beta/openai/images/generations works, although it has its own problems e.g. it does not return tokens usage.