Gemini 3 Pro Image Preview API Usage Guide
Overview
Gemini 3 Pro Image Preview creates high-quality images from descriptive prompts and can blend in multiple reference images supplied as URLs. You can control aspect ratio, output resolution (1K/2K/4K) and the number of images per request. This model is hosted on Google AI Studio and requires a Google API key.Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header:Submit Image Generation Request
Base URL
Endpoint
Request Format
Request Parameters
| Parameter | Type | Required | Description | Default | Constraints |
|---|---|---|---|---|---|
prompt | string | Yes | Text description of the desired image (max 2000 characters). | - | Required |
image | string/array | No | Optional reference image URLs (up to 14). Supported: PNG, JPEG, WebP, HEIC, HEIF. Max 7MB inline. | - | Optional |
image_size | string | No | Target resolution for generated images. | ”1K” | Options: “1K”, “2K”, “4K” |
aspect_ratio | string | No | Aspect ratio of the generated image. | ”1:1” | Options: “1:1”, “4:5”, “5:4”, “3:4”, “4:3”, “9:16”, “16:9”, “21:9” |
image_output_format | string | No | Output image format. | ”png” | Options: “png”, “jpeg” |
contents | array | No | Multi-turn conversation payload for iterative editing. When provided, prompt and image are ignored. | - | See multi-turn section |
Response
Check Request Status
Endpoint
Example
Response
Request Status Values
| Status | Description |
|---|---|
queued | Request is waiting to be processed |
processing | Video generation is in progress |
success | Video generation completed successfully |
failed | Video generation failed |
cancelled | Request was cancelled |
List Your Requests
Endpoint
Example
Get Model Information
Endpoint
Example
List Available Models
Endpoint
Example
Response
Multi-turn Conversation (Iterative Image Editing)
This model supports multi-turn conversations for iterative image editing. After generating an image, you can continue refining it by providing additional instructions.How It Works
- First Turn: Send a regular request with
prompt(and optionalimage) - Response: The response includes
next_turn_contents- a pre-formatted conversation history - Next Turn: Copy
next_turn_contentsto your payload’scontentsfield, then add your new instruction to the last user turn - Repeat: Continue iterating until satisfied
First Turn Request
First Turn Response (with next_turn_contents)
Second Turn Request (Using next_turn_contents)
Copynext_turn_contents to contents, then fill in the last user turn with your new instruction:
Multi-turn Tips
- Text-only edits: Just fill in the
textfield in the last user turn - Add reference image: Include a
fileDatawithfileUripointing to a GCS or HTTP URL - Empty fields are ignored: Empty
textorfileUriare automatically filtered out - Conversation history: Each response includes updated
next_turn_contentsfor the next iteration
Tips for Better Results
- Prompt Clarity: Use detailed, specific prompts for precise results.