Image Generation
Generate AI images from text prompts with support for references, templates, and chaining.
Basic Generation
Generate an image by sending a text prompt to the generations endpoint:
curl -X POST https://api.banatie.app/api/v1/generations \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"prompt": "a serene mountain landscape at sunset",
"aspectRatio": "16:9"
}'The response contains your generated image immediately:
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "success",
"prompt": "a serene mountain landscape at sunset",
"aspectRatio": "16:9",
"outputImage": {
"id": "8a3b2c1d-4e5f-6789-abcd-ef0123456789",
"storageUrl": "https://cdn.banatie.app/my-org/my-project/img/8a3b2c1d-4e5f-6789-abcd-ef0123456789",
"width": 1792,
"height": 1008
},
"flowId": "770e8400-e29b-41d4-a716-446655440002"
}
}One request, one result. The storageUrl is your production-ready image, served via CDN.
Aspect Ratios
Choose the aspect ratio that fits your use case:
Ratio | Dimensions | Best For |
|---|---|---|
1:1 | 1024 x 1024 | Social media posts, profile pictures, thumbnails |
16:9 | 1792 x 1008 | Blog headers, presentations, video thumbnails |
9:16 | 1008 x 1792 | Stories, mobile backgrounds, vertical banners |
3:2 | 1536 x 1024 | Photography-style images, print layouts |
21:9 | 2016 x 864 | Ultra-wide banners, cinematic headers |
Default is 16:9 if not specified.
Prompt Templates
Templates improve your prompt for specific styles. Available templates:
Template | Description |
|---|---|
general | Balanced style for most use cases |
photorealistic | Photo-like realism with natural lighting |
illustration | Artistic illustration style |
minimalist | Clean, simple compositions |
sticker | Sticker-style with clear edges |
product | E-commerce product photography |
comic | Comic book visual style |
Using Reference Images
Add reference images for style guidance or context. Pass image IDs or aliases in the referenceImages array:
curl -X POST https://api.banatie.app/api/v1/generations \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"prompt": "product photo in this style",
"referenceImages": ["@brand-style", "@product-template"],
"aspectRatio": "1:1"
}'@logo instead of UUIDs. See Working with Images to learn about aliases.You can also mention aliases directly in your prompt text — they're auto-detected:
{
"prompt": "create a banner using @brand-colors and @logo style"
}Continuing Generation
Chain multiple generations together by passing the same flowId:
curl -X POST https://api.banatie.app/api/v1/generations \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"prompt": "same scene but at night",
"flowId": "770e8400-e29b-41d4-a716-446655440002"
}'Each response includes a flowId you can use to continue the sequence. Flows help organize related generations together.
Regeneration
Want a different result with the same parameters? Regenerate an existing generation:
curl -X POST https://api.banatie.app/api/v1/generations/550e8400-e29b-41d4-a716-446655440000/regenerate \
-H "X-API-Key: YOUR_API_KEY"Same prompt, new image. The generation ID and URL stay the same — the image content is replaced.