Nano Banana (Gemini 2.5 Flash Image)

开发者文档

Nano Banana (Gemini 2.5 Flash Image)

Gemini 2.0 Flash Preview Image Generation for prompt-based image generation through the Omixa resale gateway.

Model Reference

Image generation and editing models

Prompt-to-image, image editing, image merging, upscaling, and background removal. Endpoint: https://www.omixa.cloud/api/v1/images/generations

Nano Banana (Gemini 2.5 Flash Image)

gemini-2.0-flash-preview-image-generation

Gemini 2.0 Flash Preview Image Generation for prompt-based image generation through the Omixa resale gateway.

图像 流媒体 Context window: 32,768 tokens Max output: 8,192 tokens
input per 1m tokens $0.150000
output per 1m tokens $0.600000
image per unit $0.040000
Integration reference

Connect Nano Banana (Gemini 2.5 Flash Image)

Use Omixa's unified endpoint and your workspace API key. Provider routing, billing, failover, and usage records are handled by Omixa.

POST https://www.omixa.cloud/api/v1/images/generations
  • Provider: google
  • Endpoint type: google_gemini_image_generation
  • Context window: 32,768 tokens
  • Max output: 8,192 tokens
  • Streaming supported
Request schema

Request fields

Only send options supported by this model. Required fields and accepted values are listed below.

Field 类型 Required Accepted values 描述
model string Yes gemini-2.0-flash-preview-image-generation Use `gemini-2.0-flash-preview-image-generation`. Omixa resolves the active provider route and failover key automatically.
prompt string Yes Any valid value Natural language instruction for the generated or edited image.
n integer No 1-10 Number of images to request. Omixa caps the value by provider limits.
output_format string No png, jpeg, webp Preferred output file format.
aspect_ratio string No 1:1, 16:9, 9:16, 4:3, 3:4 Image shape. Gemini/Nano Banana and Imagen models accept common ratios.
size string No 0.5K, 1K, 2K, 4K Google image size/resolution bucket where supported.
input_images array No Any valid value Reference images for Nano Banana/Gemini image edit or merge. Keep total inline files under Omixa request limits.
person_generation string No allow_adult, allow_all, dont_allow Person generation safety control for Imagen-style models.
enhance_prompt boolean No Any valid value Lets the provider expand or rewrite the prompt when supported.
add_watermark boolean No Any valid value Provider watermark setting for Imagen-style outputs.
reasoning_effort string No minimal, high Gemini image thinking level where available.
Ready to send

Payload and response

Start with this model-safe payload and expect the normalized Omixa response shape shown beside it.

Example JSON payload
{
    "model": "gemini-2.0-flash-preview-image-generation",
    "prompt": "A premium black and white product dashboard, clean glass UI, high contrast.",
    "n": 1,
    "output_format": "png",
    "aspect_ratio": "1:1",
    "size": "1K",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-reference>"
            }
        }
    ]
}
Response shape
{
    "created": 1780660800,
    "data": [
        {
            "b64_json": "<base64-image>",
            "url": null
        }
    ],
    "usage": {
        "billed_amount": "0.039000"
    }
}
Language examples

Copy-ready integration code

Replace the example API key with a workspace key and keep model-specific fields unchanged unless the table above marks them optional.

cURL
curl -X POST https://www.omixa.cloud/api/v1/images/generations \
  -H "Authorization: Bearer omx_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.0-flash-preview-image-generation",
    "prompt": "A premium black and white product dashboard, clean glass UI, high contrast.",
    "n": 1,
    "output_format": "png",
    "aspect_ratio": "1:1",
    "size": "1K",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-reference>"
            }
        }
    ]
}'
JavaScript fetch
const response = await fetch('https://www.omixa.cloud/api/v1/images/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer omx_live_xxx',
    'Content-Type': 'application/json'
  },
  body: "{\n    \"model\": \"gemini-2.0-flash-preview-image-generation\",\n    \"prompt\": \"A premium black and white product dashboard, clean glass UI, high contrast.\",\n    \"n\": 1,\n    \"output_format\": \"png\",\n    \"aspect_ratio\": \"1:1\",\n    \"size\": \"1K\",\n    \"input_images\": [\n        {\n            \"type\": \"image_url\",\n            \"image_url\": {\n                \"url\": \"data:image/png;base64,<base64-reference>\"\n            }\n        }\n    ]\n}"
});
const data = await response.json();
Python requests
import requests

response = requests.post(
    'https://www.omixa.cloud/api/v1/images/generations',
    headers={'Authorization': 'Bearer omx_live_xxx', 'Content-Type': 'application/json'},
    json={
    "model": "gemini-2.0-flash-preview-image-generation",
    "prompt": "A premium black and white product dashboard, clean glass UI, high contrast.",
    "n": 1,
    "output_format": "png",
    "aspect_ratio": "1:1",
    "size": "1K",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-reference>"
            }
        }
    ]
}
)
print(response.json())
PHP cURL
$ch = curl_init('https://www.omixa.cloud/api/v1/images/generations');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer omx_live_xxx', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{
    "model": "gemini-2.0-flash-preview-image-generation",
    "prompt": "A premium black and white product dashboard, clean glass UI, high contrast.",
    "n": 1,
    "output_format": "png",
    "aspect_ratio": "1:1",
    "size": "1K",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-reference>"
            }
        }
    ]
}',
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
C# HttpClient
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "omx_live_xxx");
var json = @"{
    ""model"": ""gemini-2.0-flash-preview-image-generation"",
    ""prompt"": ""A premium black and white product dashboard, clean glass UI, high contrast."",
    ""n"": 1,
    ""output_format"": ""png"",
    ""aspect_ratio"": ""1:1"",
    ""size"": ""1K"",
    ""input_images"": [
        {
            ""type"": ""image_url"",
            ""image_url"": {
                ""url"": ""data:image/png;base64,<base64-reference>""
            }
        }
    ]
}";
var response = await client.PostAsync("https://www.omixa.cloud/api/v1/images/generations", new StringContent(json, System.Text.Encoding.UTF8, "application/json"));
var body = await response.Content.ReadAsStringAsync();
Go net/http
payload := []byte(`{
    "model": "gemini-2.0-flash-preview-image-generation",
    "prompt": "A premium black and white product dashboard, clean glass UI, high contrast.",
    "n": 1,
    "output_format": "png",
    "aspect_ratio": "1:1",
    "size": "1K",
    "input_images": [
        {
            "type": "image_url",
            "image_url": {
                "url": "data:image/png;base64,<base64-reference>"
            }
        }
    ]
}`)
req, _ := http.NewRequest("POST", "https://www.omixa.cloud/api/v1/images/generations", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer omx_live_xxx")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Production checklist

Operational notes

  • Authenticate with `Authorization: Bearer omx_live_xxx`.
  • Omixa handles provider keys, routing, billing, failover, and usage recording behind this endpoint.
  • Google Vertex requests use active Vertex accounts configured by the admin; Omixa retries the next healthy account when a route fails before output starts.
  • For edits and reference workflows, send inline image data URLs. Omixa does not fetch arbitrary remote image URLs for providers that require inline media.
复制的 Markdown