Endpoints

Gemini image models use the OpenAI-compatible image task endpoint:
The synchronous endpoint is also available when the client can wait for the result:

Model IDs

Common model IDs include:
Use the model list endpoint to confirm the IDs available to the current API key.

Text-to-image

Reference images

Pass one or more public image URLs in image:
Make sure reference URLs are public and will not expire before the task completes.

Reading results

Save the returned task ID and poll until the status is succeeded 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.