Skip to main content

Endpoint

Compatible with OpenAI’s Image Generation API. The connection is held open until the upstream model returns (typically 5–30 seconds).

Request Headers

Request Body

string
required
Image model ID. e.g. google/imagen-4, blackforestlabs/flux-2-pro, ideogram/ideogram-3-0.
string
required
Text description of the image to generate.
integer
Number of images to generate. Default 1.
string
e.g. 1:1, 16:9, 9:16, 4:3, 3:4. Model-dependent — not all models honor this.
string
e.g. 1K, 2K, 4K. Model-dependent.
string
e.g. hd, standard. Model-dependent.
string
e.g. natural, vivid. Model-dependent.
string
What to exclude from the image. Model-dependent.
array
Required for image-to-image / editing / upscale / reframe / remix models. Each entry may be a public HTTPS URL or an inline base64 data: URI (e.g. data:image/png;base64,…) — inline images are decoded and hosted automatically before generation, so no provider-specific handling is needed. For anything larger than a few MB, prefer uploading via POST /v1/uploads and passing the returned URL.

Examples

Response

When R2 storage is configured, RouterBase rehosts upstream URLs on its own CDN so the links don’t expire.

Image-to-image

For i2i / editing models (e.g. blackforestlabs/flux-2-pro-i2i, ideogram/ideogram-character-edit), supply image_urls: