Hi @GUNAND_MAYANGLAMBAM and @Vishal
After accessing the models successfully I ran my testsuite of REST API calls and I stumbled upon an issue generating image(s). First, giving you the context from the API reference documentation of GenerateImagesRequest that has a property called responseFormat
:
Optional. The format in which the generated images are returned. Must be one of url or b64Json
While using the value b64Json
the call returns an HTTP 200 OK but not so when using the value url
:
{
"error": {
"code": 400,
"message": "Unsupported response format: url. Supported formats are: b64_json.",
"status": "INVALID_ARGUMENT"
}
}
Kindly fix one of it - API reference docs or API endpoint - to provide consistency. Thanks.
Here’s the REST call for reference:
#format: b64Json or Url
POST https://generativelanguage.googleapis.com/v1beta/openai/images/generations
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"prompt": "High-resolution image of Andromeda galaxy, 8k",
"model": "imagen-3.0-generate-002",
"response_format": "url",
"n": 1,
"quality": "hd"
}
Ref: OpenAI compatibility | Gemini API | Google AI for Developers