AI image generation API

Generate and edit images with 7 models from Google, OpenAI, ByteDance, Black Forest Labs, xAI, MiniMax and Alibaba, through one API key. Each image has a fixed price, from 0.8 credits (about $0.0048), and you pay only for the images that succeed.

Pay as you go from $5 · No subscription · No free trial · Failed calls are not charged

What you can do

  • Text to image

    Up to 4 images per request, in the aspect ratios and sizes each model supports.

  • Edit with reference images

    Send up to 10 reference images to Nano Banana 2.1 and MiniMax H3 Image to edit a photo or keep a look consistent.

  • Async with callbacks

    Start a task, then poll it or receive a signed callback when it is done.

All image models

Prices in API credits (1 credit = $0.006), checked December 5, 2026. GET /models is always current.

Nano Banana API

  • Google
    from 4 credits / image1K · ≈ $0.024 / image

GPT Image

  • OpenAI
    from 6 credits / image1K · ≈ $0.036 / image

Seedream

  • Seedream 4.5ByteDance
    ByteDance
    6.5 credits / image2K · 4K · ≈ $0.039 / image

FLUX

  • FLUX.2 ProBlack Forest Labs
    Black Forest Labs
    from 5 credits / image1K · ≈ $0.03 / image

Grok Imagine

  • xAI
    from 4 credits / imagespeed · ≈ $0.024 / image

MiniMax API

  • MiniMax
    from 1.8 credits / image1K · 2K · ≈ $0.011 / image

Z-Image

  • Z-ImageAlibaba
    Alibaba
    0.8 credits / image≈ $0.0048 / image

Code

import time

import httpx  # pip install httpx

BASE = "https://api.voicica.ai/platform/v1"
HEADERS = {"Authorization": "Bearer vca_your_key_here"}  # better: os.environ["VOICICA_API_KEY"]

task = httpx.post(f"{BASE}/images/generations", headers=HEADERS, timeout=60, json={
    "model": "google/nano-banana-2.1",
    "prompt": "A night market in Bangkok, neon signs, light rain, 35 mm photo",
    "n": 2,
    "aspect_ratio": "16:9",
    "resolution": "2K",
    # "image_urls": ["https://example.com/ref.png"],  # google/nano-banana-2.1 and minimax/minimax-h3-image only
    # "callback_url": "https://example.com/hooks/voicica",
    "metadata": {"project": "my-project", "node": "thumbnails"},
})
task.raise_for_status()  # 202 Accepted
task = task.json()        # {"id": "imggen_...", "status": "pending", "credits": "12.0000", ...}

while task["status"] in ("pending", "running"):
    time.sleep(5)  # 5 s or more; some models take about 4 minutes
    task = httpx.get(f"{BASE}/images/generations/{task['id']}", headers=HEADERS, timeout=60).json()

for image in task["data"]:
    if image["status"] == "succeeded":
        print(image["url"])  # download it: deleted after expires_at (30 days)
    else:
        print(image["index"], image["error"]["code"])
print(task["credits"])  # final charge: the succeeded images only

More examples (callbacks, polling, errors) are in the docs.

How it works

  1. POST /images/generations returns 202 with a task id and the credits it will take.

  2. Poll GET /images/generations/{id} every 5 s, or pass callback_url for a signed callback.

  3. Download the result within 30 days. Failed or timed-out tasks are refunded in full.

FAQ

Which image models can I use?

Nano Banana 2.1, GPT Image 2, Seedream 4.5, FLUX.2 Pro, Grok Imagine, MiniMax H3 Image and Z-Image. GET /models always has the current list.

How much does an image cost?

Each model and size has a fixed price per image, from 0.8 credits (Z-Image, about $0.0048) to 16 credits (GPT Image 2 at 4K, about $0.096). A 2K Nano Banana 2.1 image is 6 credits (about $0.036).

Can I edit an existing image?

Yes, on Nano Banana 2.1 and MiniMax H3 Image: pass up to 10 reference images in image_urls (public https URLs, PNG, JPEG or WebP, up to 10 MB each). The other models are text to image.

What if some images fail?

You pay only for the images that succeed. Credits are taken when the task starts and the failed images are refunded when it ends.

Is there a free trial?

No. There is no free trial or free credit. The smallest top-up is $5, about 833 API credits.

Get your API key

Top up from $5, create a key and call any of 7 image models in a few minutes.

Model names are trademarks of their owners (Google, OpenAI, ByteDance, Black Forest Labs, xAI, MiniMax, Alibaba). Voicica provides access to these models through APIs and is not affiliated with or endorsed by them.