APIMODELSAPIMODELS
Документация API

apimodels.app

Docs/Gemini Image API

Gemini Image API

Google's Gemini image generation models. Supports text-to-image and image editing with flexible resolution and aspect ratio control.

Authentication

Authorization: Bearer YOUR_API_KEY

Models & pricing

ModelmodelPriceNotes
Gemini 2.5 Flash Imagegemini-2.5-flash-image$0.0200/imageStandard
Gemini 3 Pro Imagegemini-3-pro-image$0.08-$0.13/image1K/2K $0.08 (40% off official), 4K $0.13 (46% off), highest quality
Gemini 3.1 Flash Imagegemini-3.1-flash-image$0.04-$0.10/imageGA release; 512 $0.04, 1K/2K $0.06, 4K $0.10
Nanobanana2nanobanana2/gemini-3.1-flash-image-preview$0.05 / 4K $0.081K/2K $0.05, 4K $0.08
Nano Banana 2.1nano-banana-2-1$0.022-$0.06/image1K $0.022, 2K $0.036, 4K $0.06; up to 10 references, 15 aspect ratios (full parameters on its own page)
Nanobanana-2-litenanobanana-2-lite/gemini-3.1-flash-image-preview$0.025Text-to-image + editing (up to 10 reference images); flat $0.025, 1K only
Nanobanana-2-betananobanana-2-beta/gemini-3.1-flash-image-preview$0.05 / 4K $0.081K/2K $0.05, 4K $0.08
Nanobananapro-geminigemini-3-pro-image-gemini$0.03/imageGemini 3 Pro, budget channel
Nanobanana2-geminigemini-3.1-flash-image-gemini$0.025/imageGemini 3.1 Flash, budget channel

Code examples

# Step 1: Create task (text-to-image)
curl -X POST https://api.apimodels.app/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image-preview",
    "prompt": "A futuristic cityscape at sunset with flying cars",
    "aspect_ratio": "16:9",
    "resolution": "2k"
  }'

# Image editing with reference image
curl -X POST https://api.apimodels.app/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image",
    "prompt": "Add dramatic storm clouds to the sky",
    "image_url": "https://example.com/photo.jpg",
    "aspect_ratio": "16:9"
  }'

# Step 2: Poll status
curl "https://api.apimodels.app/v1/images/generations?task_id=TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

Request parameters

FieldRequiredTypeDescription
modelYesstringgemini-2.5-flash-image / gemini-3-pro-image / gemini-3.1-flash-image / gemini-3-pro-image-gemini / gemini-3.1-flash-image-gemini / nanobanana2/gemini-3.1-flash-image-preview / nanobanana-2-lite/gemini-3.1-flash-image-preview / nanobanana-2-beta/gemini-3.1-flash-image-preview
promptYesstringText description or editing instructions
image_urlNostringSingle reference image URL for image editing
image_urlsNostring[]Multiple reference image URLs for multi-image editing
aspect_ratioNostring"auto" (default), "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"
resolutionNostring"1k", "2k", "4k" -- price varies by resolution
callback_urlNostringWebhook URL called when task completes

Notes

  • Pro Lite (97%) and Pro (99%) differ in success rate and price
  • Resolution affects price: 1k < 2k < 4k
  • Supports multiple reference images (image_url for single, image_urls for array)
  • Nanobananapro-gemini ($0.03/image) and Nanobanana2-gemini ($0.025/image) are budget channels
  • Nano Banana 2.1 has its own docs page (extra ratios such as 1:4 / 4:1 / 1:8 / 8:1, up to 10 references): Nano Banana 2.1 API

Try it in the Playground

FAQ

Which Gemini image models are available and what do they cost?

Gemini 2.5 Flash Image ($0.02), Gemini 3 Pro Image ($0.08-$0.13, below official), Gemini 3.1 Flash Image ($0.04-$0.10), plus Nano Banana budget channels from $0.025 per image — all on one key.

Does the Gemini image API support editing with multiple references?

Yes — pass image_url for a single reference or image_urls[] for multi-image fusion, with aspect_ratio and resolution (1k/2k/4k) control.