Docs / image / Nano Banana 2
Nano Banana 2 online
Google's flagship image model for generation and editing. Sharp detail, reliable prompt adherence, and clean text rendering at up to 4K.
Rp Mulai Rp650 / image
Rp1.440 −54.9%
nano-banana-2/base model id
1 · Create a task
Kirim permintaan untuk membuat tugas generasi image. Wajib header Idempotency-Key. Saldo direservasi sebesar estimasi; task gagal tidak ditagih.
curl -X POST https://run.getcore.id/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: my-task-001" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2/base",
"input": {
"prompt": "translation of all the text to Hindi.",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpg"
}
}'const res = await fetch('https://run.getcore.id/v1/tasks', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Idempotency-Key': 'my-task-001',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "nano-banana-2/base",
"input": {
"prompt": "translation of all the text to Hindi.",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpg"
}
}),
});
const task = await res.json();import requests
res = requests.post(
"https://run.getcore.id/v1/tasks",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "my-task-001",
},
json={
"model": "nano-banana-2/base",
"input": {
"prompt": "translation of all the text to Hindi.",
"resolution": "1K",
"aspect_ratio": "auto",
"output_format": "jpg"
}
},
)
task = res.json()Input parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
prompt |
string | Yes | A text description of the image you want to generate (max 20000 chars) | translation of all the text to Hindi. |
resolution |
string | No | Resolution of the generated image. Higher resolutions take longer to generate. Opsi: 1K 2K 4K |
1K |
image_input |
array | No | Input images to transform or use as reference (supports up to 14 images) (array of file URLs) | — |
aspect_ratio |
string | No | Aspect ratio of the generated image Opsi: 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 |
auto |
output_format |
string | No | Format of the output image Opsi: jpg png |
jpg |
2 · Poll the result
Ambil status tugas hingga selesai — poll tiap 2–5 detik.
Respons saat sukses:
{
"id": "task_9f2c…",
"status": "succeeded",
"model": "nano-banana-2/base",
"price": {
"currency": "IDR",
"estimated": 650,
"reserved": 650,
"final": 650
},
"output": {
"urls": [
"https://storage.getcore.id/outputs/task_9f2c…/0.png"
],
"expires_at": "(7 hari setelah selesai)"
}
}
Status values
| Status | Keterangan |
|---|---|
queued | Tugas sedang diantrikan. |
processing | Sedang diproses. |
succeeded | Berhasil. |
failed | Gagal — lihat error detail, tidak ditagih. |
image/png, dilayani dari CDN kami dan berlaku 7 hari — salin ke penyimpananmu sendiri untuk jangka panjang.Best practices
Bila generation gagal, task berstatus failed dengan error.code ternormalisasi (mis. moderation_blocked, upstream_error) dan price.final = 0 — saldo dikembalikan otomatis. Daftar lengkap kode error ada di Error handling. Selalu kirim Idempotency-Key unik per tugas agar retry aman.
Coba tanpa kode: jalankan model ini langsung dari Playground atau lihat di API Market.
