Nano Banana 2 API Technische Gids
Diepgaande technische documentatie voor Nano Banana 2 Visual Production Service met geavanceerde kunstmatige intelligentie mogelijkheden
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.orgoverview.api_version
v1.0.0Nano Banana 2 Implementatiegids
- 1. Registreer voor Nano Banana 2 API credentials via ons hoofdplatform
- 2. Voeg je Nano Banana 2 toegangstoken toe in de Authorization parameter
- 3. Stuur een POST verzoek naar het Nano Banana 2 visual creation endpoint
- 4. Gebruik de verstrekte Nano Banana 2 taak-ID voor statusverificatie
- 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-1234567890abcdefAanvraag 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/genAanvraagvariabelen
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model identifier (e.g., "google/gempix2") |
| prompt | string | Yes | Text prompt describing the image |
| images | array | No | Reference image URLs (max 4) |
| callback_url | string | No | Webhook 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | Unique 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 verwerkingsubmitted - Nano Banana 2 taak ingevoerd in productie reeksin_progress - Nano Banana 2 taak wordt momenteel actief verwerktsuccess - Nano Banana 2 taak succesvol afgerond met gemaakte visualsfailed - Nano Banana 2 taak gestopt vanwege technische problemenProbleem 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"
}| Field | Type | Description |
|---|---|---|
| image | string | Image 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
}
}| Field | Type | Description |
|---|---|---|
| result | array | Array of ImageGenResult objects (null if failed) |
| status | string | Final task status (success/failed) |
| task_id | string | Unique task identifier |
| consumed | string | Credits consumed by the task |
| status_reason | object | Status details including error message if failed |
Nano Banana 2 Ondersteunde Configuraties
google/gempix2Nano Banana image generation modelgoogle/gemini-2.5-flash-imageGemini 2.5 Flash image modelProbleembeheer
Uitgebreide handleiding voor het beheren van complicaties en het interpreteren van API-responsindicatoren. Alle probleemmeldingen volgen gestandaardiseerde opmaak voor efficiënte oplossingsmethoden.
HTTP-responsindicatoren
OK
Request was successful
Bad Request
Invalid request parameters or malformed JSON
Unauthorized
Invalid, missing, or expired API key
Not Found
Task not found or endpoint doesn't exist
Internal Server Error
Server-side error occurred
Aanbevolen aanpak voor probleemoplossing
- Controleer altijd HTTP-responsindicatoren voordat je de uitvoerinhoud analyseert
- Gebruik progressieve vertragingsalgoritmen voor herhaalmechanismen bij 500-fouten
- Documenteer probleemmeldingen met uitgebreide details voor troubleshooting
- Bevestig inputvaliditeit voordat je verzoeken indient om 400-fouten te voorkomen
- Los verificatieproblemen op door API-credentialupdates van klanten aan te vragen
- Volg taakvoortgang met redelijke intervallen in plaats van excessieve statusvragen
- 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;
}
}