altrouter.ai
CORE

Images

Generate and edit images through the OpenAI-compatible /images/generations endpoint. Results are re-hosted on our CDN.

Generation

PythoncURL
img = client.images.generate(
    model="nano-banana-pro",
    prompt="a red fox in the snow, cinematic",
)
print(img.data[0].url)

Editing

Pass reference images in the image field (URL or base64) — the router automatically selects the model’s edit variant.

JSON
{
  "model": "nano-banana",
  "prompt": "make the sky purple",
  "image": ["https://example.com/photo.jpg"]
}

Resolution & price

The resolution tier is set via resolution (1K · 2K · 4K) or quality: "hd" (⇒ 4K). It selects the model variant and price. Finer controls (aspect ratio, seed, size) are the model’s own params — see its page in the catalog.

i
Provider links to generated images expire in ~24h, so we immediately re-host the result to our own storage and return a permanent URL on api.altrouter.ai/media. It never expires — see Data retention.
NextErrors