Skip to main content

Nano Series

Use Nano Series models to generate images from text or edit one or more reference images. UniAll exposes the same API key and model family through two request styles; choose one style for each integration.

Choose An API Style​

Use caseRecommended guideResult format
Nano Banana 2.1 with OpenAI Images fields and reference URLsNano Banana 2.1 — OpenAI ImagesURL in data[].url
Nano Banana 2.1 with Gemini fields and Base64 referencesNano Banana 2.1 — Gemini generateContentBase64 in candidates[].content.parts[].inlineData.data
nano-banana-2, nano-banana-pro, or nano-banana-2-lite with OpenAI Images or asynchronous jobsOpenAI Images FormatURL in data[].url
nano-banana-2, nano-banana-pro, or nano-banana-2-lite with GeminiGemini generateContent FormatBase64 in candidates[].content.parts[].inlineData.data

Both styles use https://api.uniall.ai and the same UniAll API key. Do not mix parameter names between the two formats.

ModelResolutionsDefaultRecommended use
nano-banana-2.11k, 2k, 4k1kSynchronous generation and editing, up to 14 reference images, and thinking control.
nano-banana-20.5k, 1k, 2k, 4k1kGeneral generation, editing, and fast 0.5K previews.
nano-banana-pro1k, 2k, 4k1kHigher-detail generation and editing.
nano-banana-2-lite1k1kLightweight 1K workloads.

Use these unified, lowercase model IDs for new integrations. Actual availability depends on the models enabled for your account.

For Nano Banana 2.1, the Gemini URL uses the official ID gemini-nano-banana-2.1. The compatible Gemini URL using nano-banana-2.1 remains available. OpenAI Images examples use model: "nano-banana-2.1".

Nano Banana 2.1 Integration​

The two 2.1 guides describe independent request formats:

  • OpenAI: POST /v1/images/generations for text to image; POST /v1/images/edits for editing. Use Authorization: Bearer <UNIAI_API_KEY> and top-level resolution, aspect_ratio, and thinking_level.
  • Gemini: POST /v1beta/models/gemini-nano-banana-2.1:generateContent. Use x-goog-api-key: <UNIAI_API_KEY> and generationConfig.imageConfig / generationConfig.thinkingConfig.

Both return one image synchronously. 2.1 does not support /v1/images/tasks or /v1/chat/completions, 0.5K/512/8K, search, custom pixel sizes, masks, transparent backgrounds, or streaming. Omit search fields even when their value is false.

2.1 supports 14 aspect ratios:

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

Resolution is a tier rather than a fixed longest-edge pixel count; a non-square 1K image can be 1376 × 768. PNG/JPEG/WebP references retain their order and duplicate entries; duplicates count toward the 14-image limit.

Thinking control defaults to medium in OpenAI and MEDIUM in Gemini. It is available only for 2.1; do not add it to nano-banana-2, nano-banana-pro, or fixed-resolution compatibility models.

Supported Aspect Ratios​

The other three models (nano-banana-2, nano-banana-pro, and nano-banana-2-lite) support:

1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9

The resolution field differs by API style:

OutputOpenAI ImagesGemini generateContent
0.5Kresolution: "0.5k"imageSize: "512"
1Kresolution: "1k"imageSize: "1K"
2Kresolution: "2k"imageSize: "2K"
4Kresolution: "4k"imageSize: "4K"

0.5K is available only for nano-banana-2. Do not send 512K, and do not use 0.5k as a Gemini imageSize.

Legacy Model IDs​

Earlier fixed-resolution IDs such as NanoBanana2-1K and NanoBananaPro-2K may remain accepted for compatibility. They are deprecated compatibility aliases and may be removed at any time. New integrations should use a unified model ID and select the resolution in the request.

Integration Checklist​

  • Keep n set to 1; each request currently generates one image.
  • Use a server-accessible HTTP(S) URL or a complete Data URL for OpenAI-style reference images.
  • Use raw Base64 without a data:image/...;base64, prefix inside Gemini inlineData.data.
  • Set synchronous client timeouts up to 600 seconds when needed.
  • Do not retry immediately after a client timeout; the original generation may still complete.
  • Transfer temporary result URLs to your own storage if you need permanent retention.
  • Never log API keys or complete Base64 image payloads.