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 case | Recommended guide | Result format |
|---|---|---|
| Nano Banana 2.1 with OpenAI Images fields and reference URLs | Nano Banana 2.1 — OpenAI Images | URL in data[].url |
| Nano Banana 2.1 with Gemini fields and Base64 references | Nano Banana 2.1 — Gemini generateContent | Base64 in candidates[].content.parts[].inlineData.data |
nano-banana-2, nano-banana-pro, or nano-banana-2-lite with OpenAI Images or asynchronous jobs | OpenAI Images Format | URL in data[].url |
nano-banana-2, nano-banana-pro, or nano-banana-2-lite with Gemini | Gemini generateContent Format | Base64 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.
Recommended Models
| Model | Resolutions | Default | Recommended use |
|---|---|---|---|
nano-banana-2.1 | 1k, 2k, 4k | 1k | Synchronous generation and editing, up to 14 reference images, and thinking control. |
nano-banana-2 | 0.5k, 1k, 2k, 4k | 1k | General generation, editing, and fast 0.5K previews. |
nano-banana-pro | 1k, 2k, 4k | 1k | Higher-detail generation and editing. |
nano-banana-2-lite | 1k | 1k | Lightweight 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/generationsfor text to image;POST /v1/images/editsfor editing. UseAuthorization: Bearer <UNIAI_API_KEY>and top-levelresolution,aspect_ratio, andthinking_level. - Gemini:
POST /v1beta/models/gemini-nano-banana-2.1:generateContent. Usex-goog-api-key: <UNIAI_API_KEY>andgenerationConfig.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:
| Output | OpenAI Images | Gemini generateContent |
|---|---|---|
| 0.5K | resolution: "0.5k" | imageSize: "512" |
| 1K | resolution: "1k" | imageSize: "1K" |
| 2K | resolution: "2k" | imageSize: "2K" |
| 4K | resolution: "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
nset to1; 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 GeminiinlineData.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.