Nano Banana Lite

POSThttps://api.newportai.com/api/async/google_gemini_image_lite

The Nano Banana Lite Text To Image API uses Gemini 3.1 Flash Lite Image to generate 1K images from text prompts.

  • Submit a POST request with your text prompt and configuration to obtain a taskId.
  • Submit a POST request to the Polling API with the taskId to retrieve the generated images.
  • Configure a Callback URL to receive results automatically on completion.

Request Headers

Content-Type string Required

Enum: application/json

Authorization string Required

Bearer authentication token. Example: Bearer {{APIKey}}.

Request Body

model string Optional

The model identifier. Default: gemini-3.1-flash-lite-image. This parameter can be omitted; when provided, it must equal gemini-3.1-flash-lite-image.

text string Required

The text prompt describing the image to generate. Example: Create a clean infographic titled YOUR EVERYDAY TOTE, featuring a canvas tote bag with three illustrated highlights: roomy interior, sturdy handles, and reusable design. Clear English labels, a soft neutral color palette, and generous spacing..

imageSize string Optional

The output image resolution. Only 1K is supported. Default: 1K. Values are case-insensitive.

aspectRatio string Optional

The output aspect ratio. Supported values: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. Default: 9:16.

Response

code integer

Returns 0 for success, or a specific error code.

message string

Returns "success" or a descriptive error message.

data object
taskId string

The unique identifier for the task. Use this ID with the Polling API to retrieve the generated output.

Errors

10192Illegal param. One or more request parameters are invalid or missing.

Polling

Use the Polling API to retrieve the processing results.

Callback

Alternatively, you can enable Callback to receive task results automatically on completion.

0Task Completed (status: 3)
{
  "code": 0,
  "message": "success",
  "data": {
    "images": [
      {
        "imageUrl": "https://dreamapi-rs-aigc.newportai.com/dreamapi/o/2026-11-05/08e8060517e644649d7651442d4c635d.jpeg",
        "imageType": "png"
      }
    ],
    "task": {
      "taskId": "API-d1c002f598c34c50bf6ff66e82a0ddb7",
      "status": 3,
      "errorCode": 0,
      "reason": "ok",
      "taskType": "google_gemini_image_lite",
      "executionTime": 250167,
      "expire": 1793872122195,
      "creditsConsumed": 10
    }
  }
}
Request
cURL
curl -X POST 'https://api.newportai.com/api/async/google_gemini_image_lite' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{key}}' \
  -d '{
  "text": "Create a clean infographic titled YOUR EVERYDAY TOTE, featuring a canvas tote bag with three illustrated highlights: roomy interior, sturdy handles, and reusable design. Clear English labels, a soft neutral color palette, and generous spacing.",
  "aspectRatio": "4:3",
  "imageSize": "1K"
}'
0Successful
{
    "code": 0,
    "message": "success",
    "data": {
        "taskId": "API-d1c002f598c34c50bf6ff66e82a0ddb7"
    }
}