Endpoints
Gemini image models use the OpenAI-compatible image task endpoint:Model IDs
Common model IDs include:Text-to-image
Reference images
Pass one or more public image URLs inimage:
Reading results
Save the returned task ID and poll until the status issucceeded or failed. On success, read the data array. On failure, read error.message and preserve the full response for diagnosis.
aspect_ratio controls the frame, while image_size controls the output tier. Supported values depend on the model, so keep the model’s error response when a combination is rejected.