Nano Banana 2 Lite

Nano Banana 2 Lite is a lightweight image generation and editing model served through the Kie jobs API. It currently supports 1K output only.

Model

Model NameOutputAspect Ratios
nano-banana-2-liteImage1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9, auto

Pricing

ResolutionCreditsPrice
1K10 credits$0.05

Create Task

curl -X POST https://api.aivideoapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2-lite",
    "callback_url": "https://your-server.com/webhook",
    "input": {
      "prompt": "A polished comic-style launch scene in a bright creative workspace",
      "aspect_ratio": "16:9"
    }
  }'

Request Body

FieldTypeRequiredDescription
modelstringYesMust be nano-banana-2-lite
inputobjectYesGeneration parameters, see below
callback_urlstringNoURL to receive task completion/failure notifications

Input Object

FieldTypeRequiredDescription
promptstringYesText description of the desired image, max 20,000 characters
aspect_ratiostringNoAspect ratio, default auto
image_urlsstring[]NoUp to 10 image URLs for reference or editing (JPEG, PNG, WebP)
resolutionstringNo1K only; defaults to 1K

output_format, 2K, and 4K are not supported by Nano Banana 2 Lite.

Example: Image Editing

curl -X POST https://api.aivideoapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2-lite",
    "input": {
      "prompt": "Transform this product photo into a clean studio advertisement",
      "image_urls": [
        "https://example.com/product.png"
      ],
      "aspect_ratio": "4:5"
    }
  }'

Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "397ce9f2-c04e-4244-ac33-3af19a7cc297"
  }
}

Query Task

curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
  -H "Authorization: Bearer sk-your-api-key"

Status transitions: pending -> processing -> completed or failed.

Completed

{
  "id": "397ce9f2-c04e-4244-ac33-3af19a7cc297",
  "status": "completed",
  "model": "nano-banana-2-lite",
  "output": {
    "urls": [
      "https://file.aivideoapi.ai/images/2026/07/02/abc123.jpg"
    ],
    "metadata": {
      "model": "nano-banana-2-lite",
      "costTime": 12000
    }
  }
}

Callback

Pass callback_url when creating the task. The system sends a POST request when the task completes or fails. The callback format matches the query task response.


Error Codes

When a request fails, the API returns a JSON error response:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

Error Reference

HTTP StatusCodeTypeDescription
400invalid_requestinvalid_request_errorMissing or invalid parameters
401invalid_api_keyauthentication_errorAPI key is invalid, disabled, or deleted
402insufficient_creditsbilling_errorCredit balance too low, please top up
403ip_not_allowedpermission_errorRequest IP not in the key's allowlist
404model_not_foundinvalid_request_errorModel does not exist or is inactive
404task_not_foundinvalid_request_errorTask ID does not exist
429rate_limit_exceededrate_limit_errorToo many requests, please slow down
429spend_limit_exceededbilling_errorKey spend limit reached (hourly/daily/total)
500internal_errorapi_errorUnexpected server error
503upstream_errorupstream_errorUpstream AI provider returned an error

Common Scenarios

invalid_request (400)

Returned when required fields are missing or invalid.

{
  "error": {
    "code": "invalid_request",
    "message": "'model' is required.",
    "type": "invalid_request_error"
  }
}

insufficient_credits (402)

Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.

invalid_api_key (401)

Possible causes:

  • The key does not start with sk-
  • The key has been disabled or deleted
  • The user account has been banned

upstream_error (503)

The upstream AI provider returned an error. This may happen when:

  • The input contains sensitive or prohibited content
  • The provider is temporarily unavailable
  • The request parameters are not supported by the provider

Credits are automatically refunded when a task fails due to upstream errors.