Nano Banana 2 API Technische Gids

Diepgaande technische documentatie voor Nano Banana 2 Visual Production Service met geavanceerde kunstmatige intelligentie mogelijkheden

Bekijk PrijzenOntdek Nano Banana 2 abonnement opties

Nano Banana 2 API Introductie

De Nano Banana 2 Visuele Productie API maakt integratie mogelijk met geavanceerde kunstmatige intelligentie systemen voor het maken van hoogwaardige visuals uit tekstuele beschrijvingen en voorbeeldafbeeldingen. Ons Nano Banana 2 platform biedt een eenvoudige REST architectuur met uitgebreide taakcoördinatie en notificatiemogelijkheden.

Nano Banana 2 Kernfuncties

  • Nano Banana 2 tekst-naar-beeld transformatie met geavanceerde AI systemen
  • Nano Banana 2 compatibiliteit met voorbeeldafbeeldingen (maximaal 4 afbeeldingen)
  • Nano Banana 2 non-blocking taakuitvoering met voortgangsmonitoring
  • Nano Banana 2 webhook integratie voor directe statusupdates
  • Nano Banana 2 REST architectuur met JSON-geformatteerde responses
  • Nano Banana 2 Bearer verificatiesysteem

overview.base_url

https://api.defapi.org

overview.api_version

v1.0.0

Nano Banana 2 Implementatiegids

  1. 1. Registreer voor Nano Banana 2 API credentials via ons hoofdplatform
  2. 2. Voeg je Nano Banana 2 toegangstoken toe in de Authorization parameter
  3. 3. Stuur een POST verzoek naar het Nano Banana 2 visual creation endpoint
  4. 4. Gebruik de verstrekte Nano Banana 2 taak-ID voor statusverificatie
  5. 5. Verkrijg je Nano Banana 2 gegenereerde visuals wanneer de taak is voltooid

Identiteitsverificatie

Elke API-aanvraag vereist authenticatie via Bearer token verificatie. Voeg je toegangsgegevens toe in de Authorization parameter voor elke verzending.

Verificatiemethode

Implementeer HTTP Bearer token validatie door je toegangsgegevens in de Authorization parameter in te voegen:

Authorization: Bearer <your-api-key>

Voorbeeld Toegangssleutel Structuur

Authorization: Bearer dk-1234567890abcdef

Aanvraag Demonstratie

curl -X POST "https://api.defapi.org/api/image/gen" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key-here" \
  -d '{
    "model": "google/gempix2",
    "prompt": "A beautiful landscape"
  }'

Succesvolle Verificatie

  • Toegangsgegevens blijven actueel
  • Klantregistratie behoudt actieve status
  • Voldoende servicecredits blijven bestaan

Veelvoorkomende Problemen

  • Ontbrekende toegangsgegevens
  • Onjuiste toegangssleutel configuratie
  • Gedeactiveerde of opgeschorte registratie

Nano Banana 2 Visuele Productie API

Creëer beelden met Nano Banana 2 door gebruik van geavanceerde kunstmatige intelligentie systemen en aanpasbare tekstinstructies plus voorbeeldbeelden.

Verbindingsterminal

POST /api/image/gen

Aanvraagvariabelen

ParameterTypeRequiredDescription
modelstringYesModel identifier (e.g., "google/gempix2")
promptstringYesText prompt describing the image
imagesarrayNoReference image URLs (max 4)
callback_urlstringNoWebhook URL for completion notifications

Implementatie Voorbeelden

Fundamentele Nano Banana 2 Beeldcreatie

{
  "model": "google/gempix2",
  "prompt": "A beautiful girl dancing in a garden"
}

Nano Banana 2 Referentie-Gebaseerde Productie met Voorbeeldgrafiek

{
  "model": "google/gempix2",
  "prompt": "Put them in a basket",
  "images": [
    "https://cdn.openai.com/API/docs/images/body-lotion.png",
    "https://cdn.openai.com/API/docs/images/soap.png"
  ],
  "callback_url": "https://example.com/webhook/image-callback"
}

Output Structuur

{
  "code": 0,
  "message": "ok",
  "data": {
    "task_id": "ta12345678-1234-1234-1234-123456789abc"
  }
}

Probleembeheer

400 - Bad Request

{"code": 1, "message": "failed", "detail": "prompt is required"}

401 - Unauthorized

{"code": 1, "message": "Invalid API key"}

Nano Banana 2 Taak Status API

Onderzoek de voortgang en resultaten van Nano Banana 2 visuele productietaken met behulp van de taak-ID verstrekt door de Nano Banana 2 visuele creatie terminal.

Verbinding Terminal

GET /api/task/query?task_id=<task_id>

Onderzoek Variabelen

ParameterTypeRequiredDescription
task_idstringYesUnique task identifier returned from generation endpoint

Aanvraag Voorbeeld

curl -X GET "https://api.defapi.org/api/task/query?task_id=ta823dfb-eaac-44fd-aec2-3e2c7ba8e071" \
  -H "Authorization: Bearer your-api-key-here"

Nano Banana 2 Taak Status Categorieën

pending - Nano Banana 2 taak initialisatie voltooid, wacht op start verwerking
submitted - Nano Banana 2 taak ingevoerd in productie reeks
in_progress - Nano Banana 2 taak wordt momenteel actief verwerkt
success - Nano Banana 2 taak succesvol afgerond met gemaakte visuals
failed - Nano Banana 2 taak gestopt vanwege technische problemen

Probleem Antwoorden

404 - Task Not Found

{"code": 1, "message": "task not found"}

401 - Unauthorized

{"code": 401, "message": "Invalid API key"}

Nano Banana 2 Informatie Structuren

Uitgebreide documentatie voor alle Nano Banana 2 informatie configuraties en sjablonen gebruikt in API communicatie en aanvragen.

ImageGenResult

Represents a generated image result.

{
  "image": "https://google.datas.systems/fileSystem/response_images/287/2025/08/29/1756432513771985292_2989.png"
}
FieldTypeDescription
imagestringImage URL or base64 data URI

CallbackPayload

Payload sent to the callback_url when task status changes to final states.

{
  "result": [
    {
      "image": "https://google.datas.systems/fileSystem/response_images/287/2025/08/29/1756432513771985292_2989.png"
    }
  ],
  "status": "success",
  "task_id": "ta5c9705-b8ae-4cb9-aa6f-97c4fee88c8d",
  "consumed": "0.500000",
  "status_reason": {
    "message": null
  }
}
FieldTypeDescription
resultarrayArray of ImageGenResult objects (null if failed)
statusstringFinal task status (success/failed)
task_idstringUnique task identifier
consumedstringCredits consumed by the task
status_reasonobjectStatus details including error message if failed

Nano Banana 2 Ondersteunde Configuraties

google/gempix2Nano Banana image generation model
google/gemini-2.5-flash-imageGemini 2.5 Flash image model

Probleembeheer

Uitgebreide handleiding voor het beheren van complicaties en het interpreteren van API-responsindicatoren. Alle probleemmeldingen volgen gestandaardiseerde opmaak voor efficiënte oplossingsmethoden.

HTTP-responsindicatoren

200

OK

Request was successful

400

Bad Request

Invalid request parameters or malformed JSON

401

Unauthorized

Invalid, missing, or expired API key

404

Not Found

Task not found or endpoint doesn't exist

500

Internal Server Error

Server-side error occurred

Aanbevolen aanpak voor probleemoplossing

  1. Controleer altijd HTTP-responsindicatoren voordat je de uitvoerinhoud analyseert
  2. Gebruik progressieve vertragingsalgoritmen voor herhaalmechanismen bij 500-fouten
  3. Documenteer probleemmeldingen met uitgebreide details voor troubleshooting
  4. Bevestig inputvaliditeit voordat je verzoeken indient om 400-fouten te voorkomen
  5. Los verificatieproblemen op door API-credentialupdates van klanten aan te vragen
  6. Volg taakvoortgang met redelijke intervallen in plaats van excessieve statusvragen
  7. Gebruik webhook-integratie waar mogelijk om constante voltooiingsmonitoring te vermijden

Voorbeeld probleembeheer (JavaScript)

async function generateImage(prompt, apiKey) {
  try {
    const response = await fetch('https://api.defapi.org/api/image/gen', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${apiKey}`
      },
      body: JSON.stringify({
        model: 'google/gempix2',
        prompt: prompt
      })
    });

    if (!response.ok) {
      const errorData = await response.json();
      throw new Error(`API Error ${response.status}: ${errorData.message}`);
    }

    const data = await response.json();
    return data.data.task_id;

  } catch (error) {
    console.error('Image generation failed:', error.message);
    throw error;
  }
}