Images
POSThttps://api.aerless.si/v1/images/generations
The OpenAI image format, served by WAI Illustrious SDXL (SDXL family).
Sizes and price#
Every size costs the same. 1 to 4 images per request, no streaming.
| Size | Per image |
|---|---|
1024x1024 | $0.0102 |
1024x768 | $0.0102 |
768x1024 | $0.0102 |
1408x1024 | $0.0102 |
1024x1408 | $0.0102 |
1920x1088 | $0.0102 |
1088x1920 | $0.0102 |
Request#
curl https://api.aerless.si/v1/images/generations \
-H "Authorization: Bearer $AERLESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wai-illustrious-sdxl",
"prompt": "A lighthouse on a cliff at dusk, oil painting",
"n": 1,
"size": "1024x1024",
"response_format": "url"
}'import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aerless.si/v1", api_key=os.environ["AERLESS_API_KEY"])
result = client.images.generate(
model="wai-illustrious-sdxl",
prompt="A lighthouse on a cliff at dusk, oil painting",
n=1,
size="1024x1024",
response_format="b64_json",
)
print(len(result.data[0].b64_json), "base64 characters"){
"created": ‹unix time›,
"data": [
{
"url": "‹link to the image›"
}
]
}Request parameters#
| Field | Type | Notes |
|---|---|---|
model | string, required | wai-illustrious-sdxl |
prompt | string, required | Not empty; at most 3,000 characters. |
n | integer | 1 to 4. Default 1. |
size | string | One of the sizes above. Default 1024x1024. |
response_format | string | url (default) or b64_json. |
seed | integer ≥ 0 | For repeatable results. |
quality | string | Only standard (or auto) is offered. |
Fields that would change the price are refused with 400 rather than ignored: nImages, num_images, numImages, batch_size, width, height, resolution, aspect_ratio, steps, num_inference_steps, upscale, image, images, imageDataUrl, image_url, mask. Use n and size instead.
Other unknown fields are dropped. The body may be at most 256 KiB. Image prompts go through the same content check as chat.
Response#
Each item of data has url or b64_json, as you asked. Download what you want to keep: no promise is made on how long a link stays valid.
Billing#
n × $0.0102 is reserved first; only the images returned are charged, and nothing if none are. If you disconnect, the request still completes and is charged for what was returned.