Image generations

Image generations

This page describes the OpenAI-compatible image generation request format. Use it only after confirming that your LivRouter deployment, account group, and selected model expose this endpoint.

Generate an image

cURL
curl https://api.livrouter.com/v1/images/generations \  -H "Authorization: Bearer $OPENAI_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "YOUR_IMAGE_MODEL_ID",    "prompt": "A bright product photography studio with soft daylight",    "n": 1  }'

Copy the exact image model ID from the catalog. Options such as size, quality, background, and output format vary by model; start with the minimum request before adding them.

Read and save the result

Depending on the model, the response may contain data[].url or data[].b64_json. Download returned URLs before they expire, or decode base64 to a file. Do not assume every image model returns a hosted URL.

json
{  "data": [{"b64_json": "BASE64_IMAGE_DATA"}]}

Check availability and cost

A text model ID does not enable image generation. Check the model's supported parameters and billing mode before sending repeated requests. Token-based and per-request image pricing must be reconciled against the current catalog and usage record.

For modifying an existing image, use the existing Image edits guide. For understanding an image, use Vision.