API

Manage your API access and requests.

Nano Banana 2 · Documentation
Docs Models

Nano Banana 2

Generate images from text or edit images using references.

POST
/api/v1/generations

Example request

Set your FLUX_API_KEY before running. See the parameters below for supported settings.

cURL
curl https://api.flux-context.org/api/v1/generations \
  -H "Authorization: Bearer $FLUX_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana-2",
  "input": {
    "prompt": "Editorial portrait in natural light",
    "resolution": "2K",
    "aspect_ratio": "4:5"
  }
}'

Parameters

Set model to nano-banana-2. These fields belong inside input.

ParameterDescription
prompt
string · Required
Describe the desired output. Minimum 1 characters. Maximum 20,000 characters.
image_urls
string[] · Optional
Public HTTPS reference images. Video image order and count depend on mode. Up to 14 items.
resolution
string · Optional
Output resolution tier. Values are case-sensitive.
1K2K4K
Default: 1K
aspect_ratio
string · Optional
Output proportions; see mode constraints below.
auto1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9
Default: auto
output_format
string · Optional
Output file format.
pngjpeg
Default: png

Reference media

Use your own publicly accessible HTTPS media URLs. Links must remain valid throughout queueing and generation. Base64 and file upload bodies are not supported by this endpoint.

Image-to-image

cURL
curl https://api.flux-context.org/api/v1/generations \
  -H "Authorization: Bearer $FLUX_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "nano-banana-2",
  "input": {
    "prompt": "Editorial portrait in natural light",
    "resolution": "2K",
    "aspect_ratio": "4:5",
    "image_urls": [
      "https://example.com/front.jpg",
      "https://example.com/back.jpg"
    ]
  }
}'

Credits

ResolutionCredits
1K5
2K10
4K15

Constraints

One output image per request. Web search is not enabled.

Use returned dimensions when available.

Response

A successful submission returns HTTP 202 and a request ID. Response excerpt:

JSON
{
  "id": "REQUEST_ID",
  "model": "nano-banana-2",
  "status": "processing"
}
Continue readingPoll & download