Skip to main content

Welcome to the NanoBanana API!

This quickstart guide will walk you through the essential steps to start generating and editing images using our AI models.

Overview

Generate Images

Create AI images from text descriptions or edit existing images

Task Details

Query task status and get generated image results

Authentication

All API requests require authentication via Bearer Token.
1

Get Your API Key

Visit the API Key Management Page to obtain your API key.
2

Add to Request Headers

Include your API key in all requests:
Keep your API key secure and never share it publicly. If compromised, reset it immediately in the management page.

Basic Usage

1. Generate an Image

Start by creating your first image generation task:
Response:

2. Check Task Status

Use the returned taskId to monitor progress:
Status Values:
  • 0: GENERATING - Task is currently being processed
  • 1: SUCCESS - Task completed successfully
  • 2: CREATE_TASK_FAILED - Failed to create the task
  • 3: GENERATE_FAILED - Task creation succeeded but generation failed

Complete Example

Here’s a complete workflow example:

Parameters

Required Parameters

Optional Parameters

Next Steps

Generate Images

Learn about all generation parameters and advanced options

Check Account Credits

Monitor your account credit balance

Support

Need help? Contact our technical support: Ready to create amazing AI images? Start with the examples above and explore the full API capabilities!