Get started with the Banana API in minutes. Learn how to generate and edit images using AI.
Welcome to the Banana API!#
This quickstart guide will walk you through the essential steps to start generating and editing images using our AI models.Overview#
Generate Images
Create AI images from text descriptions or edit existing images
Task Details
Query task status and get generated image resultsAuthentication#
All API requests require authentication via Bearer Token.2
Add to Request Headers
Include your API key in all requests:
Keep your API key secure and never share it publicly. If compromised, reset it immediately in the management page.
Basic Usage#
1. Generate an Image#
Start by creating your first image generation task:{
"code": 200,
"msg": "success",
"data": {
"taskId": "task12345"
}
}
2. Check Task Status#
Use the returned taskId to monitor progress:0: GENERATING - Task is currently being processed
1: SUCCESS - Task completed successfully
2: CREATE_TASK_FAILED - Failed to create the task
3: GENERATE_FAILED - Task creation succeeded but generation failed
Complete Example#
Here's a complete workflow example:Parameters#
Required Parameters#
| Parameter | Type | Description |
|---|
prompt | string | Text description for image generation |
type | string | Generation type: TEXTTOIAMGE or IMAGETOIAMGE |
callBackUrl | string | Webhook callback URL |
Optional Parameters#
| Parameter | Type | Description | Default |
|---|
numImages | integer | Number of images to generate (1-4) | 1 |
imageUrls | array | Input image URLs for editing | - |
watermark | string | Watermark text for generated images | - |
Next Steps#
Generate Images
Learn about all generation parameters and advanced options
Check Account Credits
Monitor your account credit balanceSupport#
Need help? Contact our technical support:Ready to create amazing AI images? Start with the examples above and explore the full API capabilities!