Nano Banana
google/nano-banana-edit Google's lightweight, fast model: text-to-image generation and instruction-based photo editing.
Pricing: $0.02 per image · failed tasks — $0 · ~1.5 min
Output

The result will appear here.
It usually takes ~1.5 min.
recordInfo response (data):
Run a task to see the JSON.
Replace the background with a neon city at night
1. Create a task POST /api/v1/jobs/createTask
curl -X POST https://ai.aimixmedia.site/api/v1/jobs/createTask \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-123" \
-d '{
"model": "google/nano-banana-edit",
"callBackUrl": "https://your-app.example/callback",
"input": {
"prompt": "Replace the background with a neon city at night",
"image_urls": [
"https://example.com/photo.jpg"
],
"aspect_ratio": "1:1",
"output_format": "png"
}
}'import time, requests
API = "https://ai.aimixmedia.site/api/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
task = requests.post(f"{API}/jobs/createTask", headers=HEADERS, json={
"model": "google/nano-banana-edit",
"callBackUrl": "https://your-app.example/callback",
"input": {
"prompt": "Replace the background with a neon city at night",
"image_urls": [
"https://example.com/photo.jpg"
],
"aspect_ratio": "1:1",
"output_format": "png"
}
}).json()
task_id = task["data"]["taskId"]
while True:
info = requests.get(f"{API}/jobs/recordInfo", headers=HEADERS, params={"taskId": task_id}).json()["data"]
if info["state"] in ("success", "fail"):
break
time.sleep(4)
print(info["state"], info.get("resultJson") or info.get("failMsg"))const API = "https://ai.aimixmedia.site/api/v1";
const headers = { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" };
const { data } = await fetch(`${API}/jobs/createTask`, {
method: "POST", headers,
body: JSON.stringify({
"model": "google/nano-banana-edit",
"callBackUrl": "https://your-app.example/callback",
"input": {
"prompt": "Replace the background with a neon city at night",
"image_urls": [
"https://example.com/photo.jpg"
],
"aspect_ratio": "1:1",
"output_format": "png"
}
}),
}).then((r) => r.json());
let info;
do {
await new Promise((r) => setTimeout(r, 4000));
info = (await fetch(`${API}/jobs/recordInfo?taskId=${data.taskId}`, { headers }).then((r) => r.json())).data;
} while (!["success", "fail"].includes(info.state));
console.log(info.state, info.resultJson ?? info.failMsg);
Response: {"code":200,"msg":"success","data":{"taskId":"task_..."}}. callBackUrl and Idempotency-Key are optional.
2. Status and result GET /api/v1/jobs/recordInfo
curl "https://ai.aimixmedia.site/api/v1/jobs/recordInfo?taskId=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
data.state: waiting | queuing | generating | success | fail. On success data.resultJson is a JSON string with resultUrls.
3. Upload a photo (optional) POST /api/v1/files/upload
curl -X POST https://ai.aimixmedia.site/api/v1/files/upload \
-H "Authorization: Bearer YOUR_API_KEY" -F "file=@photo.jpg"
Returns data.url — pass it in input.image_urls. Any public https URL works too.
Input parameters
| Field | Type | Values |
|---|---|---|
prompt * | string | up to 5000 chars |
image_urls * | string[] (URL) | up to 10 URLs |
aspect_ratio | string | 1:1 | 9:16 | 16:9 | 3:4 | 4:3 | 3:2 | 2:3 | 5:4 | 4:5 | 21:9 | auto · default 1:1 |
output_format | string | png | jpeg · default png |

Photo editing by instruction (ID google/nano-banana-edit): replace the background, clothes or style, or merge several images. At least one reference image is required (up to 10).
Pricing
Image to Image · google/nano-banana-edit | $0.02 |
Text to Image · google/nano-banana | $0.02 |
| Task failed | $0 (auto refund) |
| Retry with the same Idempotency-Key | $0 |
Retention
Results are kept for 30 days, run history forever. Download important files in time.
API model ID: google/nano-banana-edit · aliases: nano-banana-edit