BeLive Token Hub
API ReferenceImageGemini

Native API

Native Gemini Nano Banana image generation and editing, including models, request configuration, references, grounding, thinking, responses, and limits.

Nano Banana is the name for Gemini's native image-generation capabilities. Gemini can generate, edit, and iterate on images conversationally using text, images, video, or a combination. All generated images include a SynthID watermark.

Endpoint

ItemValue
MethodPOST
URLhttps://api.tokenhub.belivestudios.com/v1/models/{model}:generateContent
Authenticationx-goog-api-key: sk-your-belive-studios-key
Content-Typeapplication/json
Image inputRaw Base64 data in inline_data
Image outputBase64 data in candidates[].content.parts[].inlineData.data

Replace {model} with a model ID available in the console. Models listed by BeLive Studio may include version or channel suffixes.

Model Selection

Nano Banana nameOfficial model IDPositioning
Nano Banana 2 Litegemini-3.1-flash-lite-imageFastest and lowest-cost model for scaled generation; not optimized for multiple references or sequential multi-turn editing
Nano Banana 2gemini-3.1-flash-imageRecommended general-purpose model, balancing speed, 4K output, world knowledge, multiple references, and text rendering
Nano Banana Progemini-3-pro-imagePremium model for complex professional assets, localization, brand consistency, and precise creative control

Text to Image

curl "https://api.tokenhub.belivestudios.com/v1/models/gemini-3.1-flash-image:generateContent" \
  -H "x-goog-api-key: sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"}]}],
    "generationConfig": {
      "responseModalities": ["TEXT", "IMAGE"],
      "responseFormat": {
        "image": {"aspectRatio": "1:1", "imageSize": "2K"}
      }
    }
  }'

Image Editing

Provide an image and a prompt to add, remove, or modify elements, change styles, or adjust color grading. Put raw Base64 data in inline_data.data without a data:image/...;base64, prefix.

curl "https://api.tokenhub.belivestudios.com/v1/models/gemini-3.1-flash-image:generateContent" \
  -H "x-goog-api-key: sk-your-belive-studios-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [
      {"text": "Add sunglasses to the cat; keep everything else unchanged"},
      {"inline_data": {"mime_type": "image/png", "data": "IMAGE_BASE64"}}
    ]}],
    "generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
  }'

Ensure that you have the necessary rights to images you upload and comply with the applicable use policies.

Multiple Reference Images

Add multiple inline_data parts and describe how each reference should be used. Gemini 3 image models accept up to 14 reference images.

{
  "contents": [{"parts": [
    {"text": "Use the person from image one and the clothing from image two"},
    {"inline_data": {"mime_type": "image/png", "data": "FIRST_IMAGE_BASE64"}},
    {"inline_data": {"mime_type": "image/jpeg", "data": "SECOND_IMAGE_BASE64"}}
  ]}],
  "generationConfig": {
    "responseModalities": ["TEXT", "IMAGE"],
    "responseFormat": {"image": {"aspectRatio": "3:4", "imageSize": "2K"}}
  }
}
ModelHigh-fidelity objectsCharacter consistencyStyle references
Gemini 3.1 Flash Lite ImageUp to 14N/AN/A
Gemini 3.1 Flash ImageUp to 10Up to 4N/A
Gemini 3 Pro ImageUp to 6Up to 5Up to 3

Multi-turn Editing

Gemini supports conversational, multi-turn image editing. Include the preceding conversation and model response in the next request to preserve visual context and consistency.

Gemini 3 responses include thought_signature. Pass received signatures back exactly in later turns. The official Google Gen AI SDK handles them automatically when using its chat interface.

Request Structure and Key Fields

FieldTypeDescription
contents[]arrayConversation content
contents[].rolestringOptional role, such as user or model
contents[].parts[]arrayText, image, video, and other content parts
parts[].textstringGeneration or editing instruction
parts[].inline_data.mime_typestringInput image MIME type, such as image/png
parts[].inline_data.datastringRaw Base64 without a data-URL prefix
generationConfig.responseModalitiesarrayDefaults to text and image; use ["IMAGE"] for image-only output
generationConfig.responseFormat.image.aspectRatiostringOutput aspect ratio
generationConfig.responseFormat.image.imageSizestringOutput size; values are case-sensitive
generationConfig.thinkingConfig.thinkingLevelstringminimal or high for Gemini 3.1 Flash / Flash Lite; defaults to minimal
generationConfig.thinkingConfig.includeThoughtsbooleanWhether to return thoughts; thinking tokens are billed either way
tools[].google_searchobjectEnables Google Search grounding; unsupported by Flash Lite

Output Modalities

The model returns text and images by default:

{"responseModalities": ["TEXT", "IMAGE"]}

For images only:

{"responseModalities": ["IMAGE"]}

Gemini also supports interleaved text-and-image output for illustrated guides, recipes, and storyboards. The model may not always follow an exact requested image count.

Aspect Ratios and Image Sizes

When unspecified, the model matches the input image size or otherwise generates a 1:1 image.

ModelSizesMain aspect ratios
Gemini 3.1 Flash Image512, 1K, 2K, 4K1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
Gemini 3.1 Flash Lite Image1K1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
Gemini 3 Pro Image1K, 2K, 4K1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

Use uppercase K in imageSize, such as 1K, 2K, or 4K; 512 has no suffix. Lowercase values such as 1k are rejected.

Google Search Grounding

Gemini 3 image models can use Google Search for real-time information such as weather, markets, and recent events. gemini-3.1-flash-lite-image does not support this feature.

{
  "tools": [{"google_search": {}}],
  "generationConfig": {"responseModalities": ["TEXT", "IMAGE"]}
}

The response groundingMetadata contains search suggestions, sources, and mappings between content and citations. Display attribution as required by Google.

Gemini 3.1 Flash Image also supports Google Image Search grounding, alone or with web search, but it cannot search for people.

Video to Image

Gemini 3.1 Flash Image and Flash Lite Image can use video as multimodal context for thumbnails, posters, and summary infographics. Pass a public YouTube URL or upload a local video with the Files API. Image generation does not support audio input.

Thinking

Thinking is enabled by default for Gemini 3 image models and cannot be completely disabled through the API. The model may generate up to two interim thought images; the last image is the final render.

Response parts can include:

  • thought: true: marks thought content
  • thought_signature: encrypted reasoning context that must be returned in later turns

Response

Text and generated images are returned in:

candidates[].content.parts[]
FieldDescription
parts[].textText returned by the model
parts[].inlineData.mimeTypeImage MIME type
parts[].inlineData.dataBase64 image data to decode and save
parts[].thoughtWhether the part contains thought content
parts[].thoughtSignatureThought signature required for multi-turn requests
candidates[].finishReasonCandidate stop reason
candidates[].safetyRatingsSafety ratings
usageMetadataInput, output, and total token usage
groundingMetadataSources and attribution when grounding is enabled

The native endpoint does not directly return image URLs.

Best Practices

  • Describe the scene narratively instead of listing disconnected keywords
  • State the purpose, composition, camera, lighting, materials, and exact text
  • Break complex scenes into ordered steps
  • Iterate with small conversational edits instead of restarting every time
  • Use positive semantic descriptions instead of simple negative prompts
  • Provide clear references when character, product, or brand consistency matters

Limitations

  • Best-supported languages include Chinese, English, Japanese, Korean, and the other languages listed by Google
  • Audio input is unsupported; video input is limited to selected Gemini 3.1 image models
  • The model may not return the exact requested number of images
  • gemini-3.1-flash-image works best with no more than three input images
  • For text in images, first generate the text and then ask the model to place it in the image
  • Google Image Search grounding does not support real-person image searches
  • All generated images include a SynthID watermark

On this page