Rivya AI-docs
Model-API-pagina's

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.

Beschikbaar via APITekst of URL gereed; referentiemodi gebruiken Files APIImage
API-model-id

nano-banana-2

Inputs

text, file

Files API

Vereist voor referentiemodi

Basiscredits

5

Mogelijkheid

Image

Facturering

FIXED

Promptlimiet

20000 tekens

Requestcontract

Stuur de model-id op topniveau. Modelspecifieke controles horen in params.

KeyTypeVereistStandaardBeschrijving
modelstringJanano-banana-2Gebruik de API-model-id nano-banana-2.
promptstringJa-Maximaal 20000 tekens voor dit model.
paramsobjectNee-Modelspecifiek parameterobject. Gebruik de rijen hieronder voor toegestane keys.
client_request_idstringNee-Optionele client-side id voor requesttracing in je systeem.

Modelparameters

KeyTypeVereistStandaardBereikOptiesBeschrijving
aspect_ratioselectNeeauto-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:8Beeldverhouding
resolutionselectNee1K-1K, 2K, 4KResolutie
output_formatselectNeejpg-jpg, pngUitvoerformaat
google_searchselectNeefalse-false, trueGoogle Search

Uploadbeleid

Upload eerst referentiebestanden en plaats daarna de teruggegeven URL en duration token in params.referenceMediaItems.

Referentieregel

Referentiebeeld: Upload maximaal 14 afbeeldingsbestanden voor beeldprojecten.

Max. bestanden

14

Geaccepteerde bestandstypen

image

Duurtoken

Video- en audioreferenties moeten durationToken uit /api/v1/files bevatten wanneer duurverificatie vereist is.

kindMax. grootteMIME-types
image30 MBimage/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.