Skip to main content
Gemini Nano Banana 2.1 is an image-generation and conversational-editing model focused on visual quality, text rendering, reference consistency, and wide-format images. Use gemini-nano-banana-2.1; do not substitute a chat-only Gemini model.

Model Information

These are model specifications. Route availability, billing, file access, and request-size limits depend on the selected channel. Image output uses the native Gemini endpoints below. POST https://api.mixroute.ai/v1/models/gemini-nano-banana-2.1:generateContent POST https://api.mixroute.ai/v1/models/gemini-nano-banana-2.1:streamGenerateContent?alt=sse

Generate an Image

Use the native generationConfig.imageConfig fields for size and aspect ratio on this endpoint. Do not add metadata, asset, an OpenAI size/n field, or a model field inside the request body. The model is selected in the URL.

Request Fields

Limits

  • Aspect ratios include 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9.
  • Up to 14 reference images, with model guidance for up to four characters and ten objects. These are input limits, not a guarantee of perfect consistency.
  • Vertex inline-image inputs are limited to 7 MB per image. PNG, JPEG, WebP, HEIC, and HEIF are supported; other request limits can be stricter.
  • Omit the unsupported sampling/randomness fields temperature, topP, topK, seed, and logprobs.
  • Audio generation, arbitrary function calling, and structured JSON output are not supported.

Editing and Multi-turn Use

Replace BASE64_IMAGE_DATA with the source bytes encoded as Base64. For conversational edits, retain the complete prior candidate.content as a model turn, followed by the next user turn. Preserve all thoughtSignature values exactly; do not replace the image history with text alone.

Read the Output

Process candidates[].content.parts[] by type. Save non-thought inlineData parts using their MIME type and decoded Base64 bytes, and read text parts separately. A response without an image requires checking promptFeedback and finishReason; HTTP success alone does not imply image output. Streaming uses streamGenerateContent?alt=sse with the same body, not a JSON stream flag. Parse SSE data events and handle image/text parts in each JSON event. Image generation and editing | Image streaming