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 Name | Output | Aspect Ratios |
|---|---|---|
nano-banana-2-lite | Image | 1: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
| Resolution | Credits | Price |
|---|---|---|
| 1K | 10 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
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be nano-banana-2-lite |
input | object | Yes | Generation parameters, see below |
callback_url | string | No | URL to receive task completion/failure notifications |
Input Object
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the desired image, max 20,000 characters |
aspect_ratio | string | No | Aspect ratio, default auto |
image_urls | string[] | No | Up to 10 image URLs for reference or editing (JPEG, PNG, WebP) |
resolution | string | No | 1K 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 Status | Code | Type | Description |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | Missing or invalid parameters |
| 401 | invalid_api_key | authentication_error | API key is invalid, disabled, or deleted |
| 402 | insufficient_credits | billing_error | Credit balance too low, please top up |
| 403 | ip_not_allowed | permission_error | Request IP not in the key's allowlist |
| 404 | model_not_found | invalid_request_error | Model does not exist or is inactive |
| 404 | task_not_found | invalid_request_error | Task ID does not exist |
| 429 | rate_limit_exceeded | rate_limit_error | Too many requests, please slow down |
| 429 | spend_limit_exceeded | billing_error | Key spend limit reached (hourly/daily/total) |
| 500 | internal_error | api_error | Unexpected server error |
| 503 | upstream_error | upstream_error | Upstream 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.