# Nano Banana 2 Lite Generate images from text prompts with Google Nano Banana 2 Lite. Lightweight, lower-cost variant with extended aspect ratios. ## API Information - **Provider:** google - **Model Slug:** google/nano-banana-2-lite/text-to-image - **Category:** text-to-image - **Status:** active - **Base Cost:** $0.024 per request - **List Price:** $0.034 per request - **Active Discount:** 30% off — already reflected in Base Cost above - **Estimated Processing Time:** 60 seconds ## Input Schema | Parameter | Type | Required | Default | Constraints | Description | |-----------|------|----------|---------|-------------|-------------| | prompt | string | Yes | - | max 32000 chars | - | | aspect_ratio | string | No | 1:1 | auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9, 1:4, 4:1, 1:8, 8:1 | - | ## Required Parameters Example ```bash curl -X POST https://api.e2x.ai/v1/jobs/submit \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/nano-banana-2-lite/text-to-image", "input": { "prompt": "Describe the scene in detail" } }' ``` ## Full Example ```bash curl -X POST https://api.e2x.ai/v1/jobs/submit \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/nano-banana-2-lite/text-to-image", "input": { "prompt": "Describe the scene in detail", "aspect_ratio": "1:1" } }' ``` ## JavaScript Fetch Example ```javascript const response = await fetch('https://api.e2x.ai/v1/jobs/submit', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ "model": "google/nano-banana-2-lite/text-to-image", "input": { "prompt": "Describe the scene in detail", "aspect_ratio": "1:1" } }) }); const result = await response.json(); console.log(result); ``` ## Output Schema ```json {} ``` ## Job Polling After submitting, poll for the job status: ```bash curl https://api.e2x.ai/v1/jobs/{JOB_ID} \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Status Values | Status | Description | |--------|-------------| | `pending` | Job submitted, waiting in queue | | `processing` | Job is being processed by a worker | | `completed` | Job finished - check `data.outputs[0].url` | | `failed` | Job failed - check `data.error.message` | | `cancelled` | Job was cancelled | ### Python Polling Example ```python import time, requests job_id = submit_response.json()["data"]["jobId"] while True: resp = requests.get(f"https://api.e2x.ai/v1/jobs/{job_id}", headers={"Authorization": "Bearer YOUR_API_KEY"}) data = resp.json()["data"] if data["status"] == "completed": print("Done!", data["outputs"][0]["url"]) break elif data["status"] == "failed": raise Exception(f"Job failed: {data['error']['message']}") time.sleep(2) ``` ## Usage Notes - All monetary values are in micro-cents (1,000,000 = $1 USD) - For structured parameters such as `elements` or `shots`, send real JSON arrays/objects, not quoted strings. - Use `webhookUrl` parameter in your submit request to receive completion callbacks instead of polling - API Base URL: `https://api.e2x.ai/v1`