Nano Banana 2 image editing API reference and interactive playground — provide an image + instruction to generate an edited result
Bearer sk-xxx) to send test requests with one click.| Parameter | Type | Required | Description |
|---|---|---|---|
contents[].parts[].text | string | Yes | Edit instruction |
contents[].parts[].inlineData.mimeType | string | Yes | image/jpeg or image/png |
contents[].parts[].inlineData.data | string | Yes | Base64-encoded image |
generationConfig.responseModalities | array | Yes | Usually ["IMAGE"] |
generationConfig.imageConfig.aspectRatio | string | No | 14 ratios, default 1:1 |
generationConfig.imageConfig.imageSize | string | No | 512 / 1K / 2K / 4K, default 1K |
API Key obtained from APIYI Console