|
| 1 | +# Gemini 3 Pro Image Preview Edit (Nano Banana Pro Preview) |
| 2 | + |
| 3 | +{% columns %} |
| 4 | +{% column width="66.66666666666666%" %} |
| 5 | +{% hint style="info" %} |
| 6 | +This documentation is valid for the following list of our models: |
| 7 | + |
| 8 | +* `google/gemini-3-pro-image-preview-edit` |
| 9 | +{% endhint %} |
| 10 | +{% endcolumn %} |
| 11 | + |
| 12 | +{% column width="33.33333333333334%" %} |
| 13 | + |
| 14 | +{% endcolumn %} |
| 15 | +{% endcolumns %} |
| 16 | + |
| 17 | +## Model Overview |
| 18 | + |
| 19 | +Google’s smartest image-to-image model as of November 2025 (preview release). The model takes multiple images as input, with the prompt defining how they are used or combined. |
| 20 | + |
| 21 | +## Setup your API Key |
| 22 | + |
| 23 | +If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up). |
| 24 | + |
| 25 | +## API Schema |
| 26 | + |
| 27 | +<details> |
| 28 | + |
| 29 | +<summary>Aspect ratio/Resolution Table</summary> |
| 30 | + |
| 31 | +| Aspect ratio | Resolution | Credits | |
| 32 | +| ------------ | ---------- | ------- | |
| 33 | +| 1:1 | 1024×1024 | 315 000 | |
| 34 | +| 2:3 | 832×1248 | 315 000 | |
| 35 | +| 3:2 | 1248×832 | 315 000 | |
| 36 | +| 3:4 | 864×1184 | 315 000 | |
| 37 | +| 4:3 | 1184×864 | 315 000 | |
| 38 | +| 4:5 | 896×1152 | 315 000 | |
| 39 | +| 5:4 | 1152×896 | 315 000 | |
| 40 | +| 9:16 | 768×1344 | 315 000 | |
| 41 | +| 16:9 | 1344×768 | 315 000 | |
| 42 | +| 21:9 | 1536×672 | 315 000 | |
| 43 | + |
| 44 | +</details> |
| 45 | + |
| 46 | +{% openapi-operation spec="gemini-3-pro-image-preview-edit" path="/v1/images/generations" method="post" %} |
| 47 | +[OpenAPI gemini-3-pro-image-preview-edit](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Google/gemini-3-pro-image-preview-edit.json) |
| 48 | +{% endopenapi-operation %} |
| 49 | + |
| 50 | +## Quick Example |
| 51 | + |
| 52 | +Let's generate an image of the specified size using a simple prompt. |
| 53 | + |
| 54 | +{% tabs %} |
| 55 | +{% tab title="Python" %} |
| 56 | +{% code overflow="wrap" %} |
| 57 | +```python |
| 58 | +import requests |
| 59 | +import json |
| 60 | + |
| 61 | +def main(): |
| 62 | + response = requests.post( |
| 63 | + "https://api.aimlapi.com/v1/images/generations", |
| 64 | + headers={ |
| 65 | + # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 66 | + "Authorization": "Bearer <YOUR_AIMLAPI_KEY>", |
| 67 | + "Content-Type": "application/json", |
| 68 | + }, |
| 69 | + json={ |
| 70 | + "model": "google/gemini-3-pro-image-preview-edit", |
| 71 | + "image_urls": [ |
| 72 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png", |
| 73 | + "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg" |
| 74 | + ], |
| 75 | + "prompt": "Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.", |
| 76 | + } |
| 77 | + ) |
| 78 | + |
| 79 | + data = response.json() |
| 80 | + print(json.dumps(data, indent=2, ensure_ascii=False)) |
| 81 | + |
| 82 | +if __name__ == "__main__": |
| 83 | + main() |
| 84 | +``` |
| 85 | +{% endcode %} |
| 86 | +{% endtab %} |
| 87 | + |
| 88 | +{% tab title="JS" %} |
| 89 | +{% code overflow="wrap" %} |
| 90 | +```javascript |
| 91 | +async function main() { |
| 92 | + const response = await fetch('https://api.aimlapi.com/v1/images/generations', { |
| 93 | + method: 'POST', |
| 94 | + headers: { |
| 95 | + // Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 96 | + 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>', |
| 97 | + 'Content-Type': 'application/json', |
| 98 | + }, |
| 99 | + body: JSON.stringify({ |
| 100 | + model: 'google/gemini-3-pro-image-preview-edit', |
| 101 | + image_urls: [ |
| 102 | + 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png', |
| 103 | + 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg' |
| 104 | + ], |
| 105 | + prompt: 'Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.', |
| 106 | + }), |
| 107 | + }); |
| 108 | +} |
| 109 | + |
| 110 | +main(); |
| 111 | +``` |
| 112 | +{% endcode %} |
| 113 | +{% endtab %} |
| 114 | +{% endtabs %} |
| 115 | + |
| 116 | +<details> |
| 117 | + |
| 118 | +<summary>Response</summary> |
| 119 | + |
| 120 | +{% code overflow="wrap" %} |
| 121 | +```json5 |
| 122 | +{ |
| 123 | + "description": "", |
| 124 | + "data": [ |
| 125 | + { |
| 126 | + "url": "https://cdn.aimlapi.com/flamingo/files/b/koala/qnutcal6jcrPr43jMp_Xg.png", |
| 127 | + "content_type": "image/png", |
| 128 | + "width": null, |
| 129 | + "height": null, |
| 130 | + "file_name": "qnutcal6jcrPr43jMp_Xg.png" |
| 131 | + } |
| 132 | + ], |
| 133 | + "meta": { |
| 134 | + "usage": { |
| 135 | + "tokens_used": 315000 |
| 136 | + } |
| 137 | + } |
| 138 | +} |
| 139 | +``` |
| 140 | +{% endcode %} |
| 141 | + |
| 142 | +</details> |
| 143 | + |
| 144 | +<table data-full-width="false"><thead><tr><th width="320.4666748046875" valign="top">Reference Images</th><th valign="top">Generated Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/t-rex (1) (1).png" alt=""><figcaption><p>Image #1</p></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/gemini-3-pro-image-preview-edit.png" alt=""><figcaption><p><kbd><code>"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect."</code></kbd></p></figcaption></figure></div></td></tr><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blue-mug (1).jpg" alt=""><figcaption><p>Image #2</p></figcaption></figure></div></td><td valign="top"></td></tr></tbody></table> |
0 commit comments