curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana-2-lite",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A small red cube on a plain white background",
"size": "1:1"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-07-01T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 401,
"error": {
"message": "Unauthorized - Invalid API key",
"type": "authentication_error"
}
}Google
Nano Banana 2 Lite
The Nano Banana 2 Lite API generates images from text or edits reference images. It is the fast Gemini 3.1 Flash Lite Image model, and output aspect ratio can be set explicitly.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana-2-lite",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A small red cube on a plain white background",
"size": "1:1"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-07-01T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 401,
"error": {
"message": "Unauthorized - Invalid API key",
"type": "authentication_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the result through the unified Query Task Status endpoint.
Models
- nano-banana-2-lite - Text-to-image generation
- nano-banana-2-lite-edit - Image editing with reference images
Required parameters
prompt- Required. Text instruction for the generated or edited image.
Optional parameters
image_urls- Required fornano-banana-2-lite-edit. Not supported fornano-banana-2-lite.size- Optional aspect ratio. If omitted, no explicit output aspect ratio is specified.
size values: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.
Examples
Text-to-Image Example
{
"model": "nano-banana-2-lite",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A small red cube on a plain white background",
"size": "1:1"
}
}
Image Editing Example
{
"model": "nano-banana-2-lite-edit",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "Change the background to a clean pale blue studio backdrop",
"image_urls": ["https://example.com/source-image.png"],
"size": "1:1"
}
}
Authorizations
All API endpoints require Bearer Token authentication.
Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Response
Task submitted successfully
Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.
200: Success400: Invalid request parameters401: Missing or invalid API key402: Insufficient credits403: Permission denied404: Resource not found408: Request timeout429: Rate limit exceeded500: Internal server error502: Upstream service error503: Service unavailable
See Error Codes for details.
Available options:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 Example:
200