Text-to-Image/Edit API Reference
API reference for the Nano Banana series (Gemini ecosystem image models). For series introduction and prompt tips, see Nano Banana Image Generation.
Text-to-Image
POST https://api.4allapi.com/v1/images/generationscurl https://api.4allapi.com/v1/images/generations \ -H "Authorization: Bearer $AIPROXY_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3.1-flash-image-portrait", "prompt": "Portrait with magazine-cover quality, natural light, shallow depth of field, with \"OMNI\" written at the bottom of the image" }'- Use model suffixes for aspect ratio and resolution:
-square/-portrait/-landscape/-three-four/-four-three, and add-2kfor high definition; - Gemini models perform well at rendering text in images; put the text content in quotes in the prompt.
Image Editing (Image-to-Image)
POST https://api.4allapi.com/v1/images/editscurl https://api.4allapi.com/v1/images/edits \ -H "Authorization: Bearer $AIPROXY_KEY" \ -F model="gemini-3.1-flash-image" \ -F image="@ref.png" \ -F prompt="Change the same person to a full-body winter snowy scene while keeping facial features consistent"- Pass multiple
imagefields in order for multiple reference images, and describe each image’s role in the prompt (subject image/style image); - For character/product consistency scenarios, prefer the editing API instead of regenerating with text-to-image.
Model Tiers
| Tier | Representative Model | Features |
|---|---|---|
| Pro | gemini-3.0-pro-image series | Highest quality, most stable details and text |
| Standard | gemini-3.1-flash-image series | Balanced quality/speed, main tier |
| Preview | gemini-3-pro-image | Early access to new capabilities |
For currently available models and pricing, refer to Model Marketplace; response structure and upload/storage notes are the same as in Text-to-Image API Reference.