Skip to content
Main Site News Console

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/generations
Terminal window
curl 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 -2k for 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/edits
Terminal window
curl 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 image fields 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

TierRepresentative ModelFeatures
Progemini-3.0-pro-image seriesHighest quality, most stable details and text
Standardgemini-3.1-flash-image seriesBalanced quality/speed, main tier
Previewgemini-3-pro-imageEarly 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.