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
| Item | Value |
|---|---|
| Method | POST |
| URL | https://api.tokenhub.belivestudios.com/v1/models/{model}:generateContent |
| Authentication | x-goog-api-key: sk-your-belive-studios-key |
| Content-Type | application/json |
| Image input | Raw Base64 data in inline_data |
| Image output | Base64 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 name | Official model ID | Positioning |
|---|---|---|
| Nano Banana 2 Lite | gemini-3.1-flash-lite-image | Fastest and lowest-cost model for scaled generation; not optimized for multiple references or sequential multi-turn editing |
| Nano Banana 2 | gemini-3.1-flash-image | Recommended general-purpose model, balancing speed, 4K output, world knowledge, multiple references, and text rendering |
| Nano Banana Pro | gemini-3-pro-image | Premium 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"}}
}
}| Model | High-fidelity objects | Character consistency | Style references |
|---|---|---|---|
| Gemini 3.1 Flash Lite Image | Up to 14 | N/A | N/A |
| Gemini 3.1 Flash Image | Up to 10 | Up to 4 | N/A |
| Gemini 3 Pro Image | Up to 6 | Up to 5 | Up 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
| Field | Type | Description |
|---|---|---|
contents[] | array | Conversation content |
contents[].role | string | Optional role, such as user or model |
contents[].parts[] | array | Text, image, video, and other content parts |
parts[].text | string | Generation or editing instruction |
parts[].inline_data.mime_type | string | Input image MIME type, such as image/png |
parts[].inline_data.data | string | Raw Base64 without a data-URL prefix |
generationConfig.responseModalities | array | Defaults to text and image; use ["IMAGE"] for image-only output |
generationConfig.responseFormat.image.aspectRatio | string | Output aspect ratio |
generationConfig.responseFormat.image.imageSize | string | Output size; values are case-sensitive |
generationConfig.thinkingConfig.thinkingLevel | string | minimal or high for Gemini 3.1 Flash / Flash Lite; defaults to minimal |
generationConfig.thinkingConfig.includeThoughts | boolean | Whether to return thoughts; thinking tokens are billed either way |
tools[].google_search | object | Enables 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.
| Model | Sizes | Main aspect ratios |
|---|---|---|
| Gemini 3.1 Flash Image | 512, 1K, 2K, 4K | 1: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 Image | 1K | 1: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 Image | 1K, 2K, 4K | 1: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 contentthought_signature: encrypted reasoning context that must be returned in later turns
Response
Text and generated images are returned in:
candidates[].content.parts[]| Field | Description |
|---|---|
parts[].text | Text returned by the model |
parts[].inlineData.mimeType | Image MIME type |
parts[].inlineData.data | Base64 image data to decode and save |
parts[].thought | Whether the part contains thought content |
parts[].thoughtSignature | Thought signature required for multi-turn requests |
candidates[].finishReason | Candidate stop reason |
candidates[].safetyRatings | Safety ratings |
usageMetadata | Input, output, and total token usage |
groundingMetadata | Sources 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-imageworks 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