Sozdai LogoDocs
Docs/Afbeelding/Tekst naar afbeelding

Nano Banana 2· Tekst naar afbeelding

Tekst naar afbeelding
POSThttps://api.foxwire.ai/v1/media/generations

#Een taak indienen

Mediageneratie is asynchroon: je krijgt direct een taak-id, zonder te wachten.

bash
curl https://api.foxwire.ai/v1/media/generations \
  -H "Authorization: Bearer $CORRY_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "nano-banana-2", "prompt": "a cute robot mascot, flat vector logo" }'
# → { "id": "cmus7q0x9000108l3f5g2abcd", "status": "queued" }

#Aanvraagparameters

ParameterTypeVerplichtStandaardBeschrijving
promptstringJa
Text prompt describing the image to generate (max 20000 chars).
image_inputstring[]Nee
Optional reference/source image URLs to transform (max 14, ≤30MB each; jpeg/png/webp).
aspect_ratiostringNeeauto
Aspect ratio of the output image.
Opties: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1
resolutionstringNee1K
Output resolution. Higher resolutions take longer to generate.
Opties: 1K, 2K, 4K
output_formatstringNeejpg
Format of the output image.
Opties: jpg, png
callback_urlstringNee
Optional public http(s) URL. We POST the task result here the moment generation finishes (success or failure).

#Poll for the result

Generation runs asynchronously — the submit call returns immediately with a task id. Poll this endpoint with that id every few seconds until status becomes succeeded (result ready) or a terminal error (failed / timeout).

GEThttps://api.foxwire.ai/v1/media/generations/{id}
bash
# take the id from the submit response, then poll every ~3s
curl https://api.foxwire.ai/v1/media/generations/cmus7q0x9000108l3f5g2abcd \
  -H "Authorization: Bearer $CORRY_KEY"
# repeat until "status" is "succeeded" (or "failed" / "timeout")

#Antwoordvoorbeeld

Bij indienen

json
{
  "id": "cmus7q0x9000108l3f5g2abcd",
  "status": "queued",
  "type": "image",
  "model": "nano-banana-2"
}

Bij succes (na pollen)

json
{
  "id": "cmus7q0x9000108l3f5g2abcd",
  "status": "succeeded",
  "type": "image",
  "model": "nano-banana-2",
  "result": { "urls": ["https://cdn.sozdai.ai/image/1782537315223-b49c0c1b771f.png"] },
  "cost": "0.0500",
  "currency": "USD"
}

Antwoordvelden

VeldTypeBeschrijving
statusstringTaakstatus: queued / submitted / succeeded / failed / timeout.
typestringMediatype: image / video / music.
modelstringHet model dat je hebt aangevraagd.
resultobjectAanwezig bij succes. result.urls is een array van permanente bestands-URL's.
errorstringFoutmelding, aanwezig wanneer de taak is mislukt.
coststringVoor deze taak in rekening gebracht bedrag — een USD-string (bijv. "0.1200"). Zie het currency-veld.
currencystringCurrency of cost — always "USD".