Nano Banana 2 API-integratie
Gebruik Nano Banana 2 via Rivya Public API v1 met model-id nano-banana-2, ondersteunde inputs, parameters, Files API-regels, credits en responsevoorbeelden.
nano-banana-2
text, file
Vereist voor referentiemodi
5
Image
FIXED
20000 tekens
Requestcontract
Stuur de model-id op topniveau. Modelspecifieke controles horen in params.
| Key | Type | Vereist | Standaard | Beschrijving |
|---|---|---|---|---|
| model | string | Ja | nano-banana-2 | Gebruik de API-model-id nano-banana-2. |
| prompt | string | Ja | - | Maximaal 20000 tekens voor dit model. |
| params | object | Nee | - | Modelspecifiek parameterobject. Gebruik de rijen hieronder voor toegestane keys. |
| client_request_id | string | Nee | - | Optionele client-side id voor requesttracing in je systeem. |
Modelparameters
| Key | Type | Vereist | Standaard | Bereik | Opties | Beschrijving |
|---|---|---|---|---|---|---|
| aspect_ratio | select | Nee | auto | - | auto, 1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 21:9, 4:1, 1:4, 8:1, 1:8 | Beeldverhouding |
| resolution | select | Nee | 1K | - | 1K, 2K, 4K | Resolutie |
| output_format | select | Nee | jpg | - | jpg, png | Uitvoerformaat |
| google_search | select | Nee | false | - | false, true | Google Search |
Uploadbeleid
Upload eerst referentiebestanden en plaats daarna de teruggegeven URL en duration token in params.referenceMediaItems.
Referentiebeeld: Upload maximaal 14 afbeeldingsbestanden voor beeldprojecten.
14
image
Video- en audioreferenties moeten durationToken uit /api/v1/files bevatten wanneer duurverificatie vereist is.
| kind | Max. grootte | MIME-types |
|---|---|---|
| image | 30 MB | image/jpeg, image/png, image/webp |
Minimale request
{
"model": "nano-banana-2",
"prompt": "A clean editorial product image on a soft studio background",
"params": {
"aspect_ratio": "auto",
"resolution": "1K",
"output_format": "jpg",
"google_search": "false"
}
}Request met referentiebestand
{
"model": "nano-banana-2",
"prompt": "A clean editorial product image on a soft studio background",
"params": {
"aspect_ratio": "auto",
"resolution": "1K",
"output_format": "jpg",
"google_search": "false",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}Create-response
Het create-endpoint geeft een publieke taak-id terug. Poll het statusendpoint totdat de taak slaagt of mislukt.
{
"id": "task_nano_banana_2_example",
"status": "queued",
"model": "nano-banana-2",
"reserved_credits": 5,
"final_credits": 0,
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}Veelvoorkomende fouten
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
Sommige modi vereisen referentie-uploads via Files API.