Nano Banana 2 text-to-image API reference and interactive playground — generate images from text prompts
Bearer sk-xxx) to send test requests with one click.| Parameter | Type | Required | Description |
|---|---|---|---|
contents[].parts[].text | string | Yes | Text prompt |
generationConfig.responseModalities | array | Yes | ["IMAGE"] or ["TEXT","IMAGE"] |
generationConfig.imageConfig.aspectRatio | string | No | 14 ratios, default 1:1 |
generationConfig.imageConfig.imageSize | string | No | 512 / 1K / 2K / 4K, default 1K |