Skip to content

Nano Banana 3.1 Flash API

Fast Nano Banana for portraits and edits

nano-banana-3-1-flashSynchronousImage inputimageLive price on TokPort: $0.065 per image

Calling the API

Base URL https://api.tokport.io, authenticated with Authorization: Bearer <key>. Create a key in your dashboard; the examples read it from TOKPORT_API_KEY. Every response carries an X-Oneapi-Request-Id header you can search in your usage log.

Text to image

POST /v1/images/generations · sync
curl https://api.tokport.io/v1/images/generations \
  -H "Authorization: Bearer $TOKPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-3-1-flash","prompt":"a neon koi swimming through clouds, cinematic lighting","size":"1024x1024","n":1}'

Synchronous. `data[]` holds one entry per generated image with `url` (or `b64_json` when requested). The `X-Oneapi-Request-Id` response header identifies the request in your usage log.

Example response
{
  "created": 1726400000,
  "data": [
    {
      "url": "https://cdn.example.com/generated/abc.png",
      "revised_prompt": "a neon koi swimming through clouds, cinematic lighting"
    }
  ]
}

All fields: schema.

Image to image

POST /v1/images/edits · sync
curl https://api.tokport.io/v1/images/edits \
  -H "Authorization: Bearer $TOKPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-3-1-flash","image":"https://example.com/reference.png","prompt":"put the product on a marble pedestal with soft studio lighting","size":"1024x1024","n":1}'

Synchronous. `data[]` holds one entry per generated image with `url` (or `b64_json` when requested). The `X-Oneapi-Request-Id` response header identifies the request in your usage log.

Example response
{
  "created": 1726400000,
  "data": [
    {
      "url": "https://cdn.example.com/generated/abc.png",
      "revised_prompt": "a neon koi swimming through clouds, cinematic lighting"
    }
  ]
}

All fields: schema.

Errors

Errors are OpenAI-shaped: {"error": {"message", "type", "code"}}. Failed requests and failed tasks are not billed. See errors & limits.