Get Started

Quick Start

Jump into using Nano Banana API with a Bearer token, JSON request body, and the two production endpoints: create and check.

What You Need

  • AA Nano Banana account with available credits
  • An API key created from the API Keys dashboard

Get Your API Key

Sign in, open the API Keys page, enter a key name, and click Create. Copy the key immediately; the full key is only shown once.

Configure Your HTTP Request Header

Base URL

HTTPS
https://nanobanana.io
HTTP
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json

Quickstart

Submit a JSON payload to create an asynchronous generation task. Save the returned task_id and use it to check the task status.

POST /api/v1/create
curl -X POST https://nanobanana.io/api/v1/create \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "nano-banana-2",
  "input": {
    "prompt": "A cinematic product photo of a futuristic banana-shaped camera",
    "aspect_ratio": "1:1",
    "resolution": "1k"
  }
}'
Response
{
  "data": {
    "task_id": "d0a8d9f2-5e01-4c5d-9f40-38d197a1c617",
    "model": "nano-banana-2",
    "status": "processing",
    "credits": 20
  }
}

Create a Task

Submit a model id and an input object to create an asynchronous generation task. This endpoint confirms that the task has been queued; it does not wait for the final media result.

POST/api/v1/create

Authorizations

Field
Type
required
Description & constraints
Authorizationstringrequired
API key passed as a Bearer token in the request header. Example: Authorization: Bearer sk_live_your_api_key

Request body

application/json
Field
Type
required
Description & constraints
modelstringrequired
Public model id. Use a model listed in the API section, for example nano-banana-2.
inputobjectrequired
Generation input. It must include a non-empty prompt. Other input fields are model-specific; refer to the corresponding model documentation before sending fields such as images, aspect ratio, duration, resolution, or count.
JSON
{
  "model": "nano-banana-2",
  "input": {
    "prompt": "A cinematic product photo of a futuristic banana-shaped camera",
    "aspect_ratio": "1:1",
    "resolution": "1k"
  }
}

Create response

application/json

A successful response returns the task id, model id, queued status, and the number of credits reserved for this task.

HTTP 201
{
  "data": {
    "task_id": "d0a8d9f2-5e01-4c5d-9f40-38d197a1c617",
    "model": "nano-banana-2",
    "status": "processing",
    "credits": 20
  }
}

Get Task Status

Poll this endpoint using the returned task ID until the task is completed or failed. We recommend polling every 5 seconds to check the latest task status.

POST/api/v1/check

Request body

application/json
Field
Type
required
Description & constraints
task_idstringrequired
The task id returned by POST /api/v1/create. Use this id to fetch task status and final result URLs.
JSON
{
  "task_id": "d0a8d9f2-5e01-4c5d-9f40-38d197a1c617"
}

Status response

application/json

When processing is complete, the response includes final result URLs and timing metadata. While the task is still running, data is returned as null.

HTTP 200
{
  "id": "adc0e6ec-9c12-44fc-b45f-112187766c3",
  "created_at": 1788652800,
  "model": "nano-banana-2",
  "status": "completed",
  "data": {
    "results": [
      "https://cdn.nanobanana.io/api/predictions/example.mp4"
    ],
    "processing_time": 48
  }
}