Images
POST https://api.viro.app/v1/images/generations — same shape as OpenAI's Images API. Priced per image, not per token — see Models for per-image pricing.
Generate an image
curl https://api.viro.app/v1/images/generations \
-H "Authorization: Bearer $VIRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "viro/flux-schnell",
"prompt": "A solar farm at sunrise, photorealistic",
"n": 1
}'from openai import OpenAI
client = OpenAI(api_key="viro_sk_live_...", base_url="https://api.viro.app/v1")
response = client.images.generate(
model="viro/flux-schnell",
prompt="A solar farm at sunrise, photorealistic",
n=1,
)
image = response.data[0]
print(image.url or image.b64_json)Parameters
prompt — required text description of the desired image.
n — number of images to generate (defaults to 1). You're charged per image actually returned.
size, response_format — passed through to the underlying model where supported.
Each returned image is either a hosted url or a b64_json string depending on the model — check whichever field is present rather than assuming one.