Create a generation
Creates an asynchronous generation task. The model id determines whether an image or video is produced — use the same endpoint for both.
Creates an asynchronous generation task. The model id determines whether an image or video is produced — use the same endpoint for both.
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Generation request. Only model and prompt are required; every other field is optional and applies to the model type that supports it (e.g. duration/resolution for video, size/aspect_ratio for image).
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana-pro", "prompt": "string" }'{ "code": 0, "message": "string", "data": { "id": "img_44160", "taskId": "string", "model": "nano-banana-pro", "type": "image", "status": "processing", "progress": 0, "error": "string", "result": { "images": [ "http://example.com" ], "videos": [ "http://example.com" ] } }}{ "code": 0, "message": "string"}{ "code": 0, "message": "string"}{ "code": 0, "message": "string"}