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
- Nano Banana 2.1GoogleGooglefrom 4 credits / image1K · ≈ $0.024 / image
GPT Image
- GPT Image 2OpenAIOpenAIfrom 6 credits / image1K · ≈ $0.036 / image
Seedream
- Seedream 4.5ByteDanceByteDance6.5 credits / image2K · 4K · ≈ $0.039 / image
FLUX
- FLUX.2 ProBlack Forest LabsBlack Forest Labsfrom 5 credits / image1K · ≈ $0.03 / image
Grok Imagine
- Grok ImaginexAIxAIfrom 4 credits / imagespeed · ≈ $0.024 / image
MiniMax API
- MiniMax H3 ImageMiniMaxMiniMaxfrom 1.8 credits / image1K · 2K · ≈ $0.011 / 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
curl https://api.voicica.ai/platform/v1/images/generations \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "alibaba/z-image", "prompt": "A red bicycle on a beach at sunset", "aspect_ratio": "1:1"}'
# then, every 5 s or more, with the id from the answer:
curl https://api.voicica.ai/platform/v1/images/generations/imggen_0123456789abcdef0123456789abcdef \
-H "Authorization: Bearer vca_your_key_here"
How it works
POST /images/generations returns 202 with a task id and the credits it will take.
Poll GET /images/generations/{id} every 5 s, or pass callback_url for a signed callback.
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.
Related
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.