Text to Image API
Generate images from prompts with Buble image models.
Text to Image API
Use mode: "text_to_image" with an image model.
Recommended models
| Model | Key | When to use |
|---|---|---|
| Nano Banana | google/nano-banana | Fast creative drafts and lightweight production images. |
| Nano Banana Pro | google/nano-banana-pro | Professional commercial visuals and higher-quality output. |
| GPT Image 2 | openai/gpt-image-2 | Complex prompt following and layout-sensitive images. |
Nano Banana Pro example
curl https://buble.ai/api/v1/generations \
-H "Authorization: Bearer $BUBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/nano-banana-pro",
"mode": "text_to_image",
"prompt": "A premium hero image for a skincare serum bottle on translucent glass, soft reflections, editorial lighting",
"aspect_ratio": "16:9",
"resolution": "1K",
"output_format": "png"
}'GPT Image 2 example
curl https://buble.ai/api/v1/generations \
-H "Authorization: Bearer $BUBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2",
"mode": "text_to_image",
"prompt": "Create a clean editorial layout image showing a modern workspace with a laptop, notebook, and coffee. Keep the composition balanced with clear negative space on the right side.",
"aspect_ratio": "16:9",
"resolution": "1K"
}'