Images
POSThttps://api.aerless.ai/v1/images/generations
The OpenAI image format, served by WAI Illustrious SDXL (SDXL family).
Sizes and price#
One price for every size. 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#
request
curl
curl https://api.aerless.ai/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"
}'Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.aerless.ai/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")Response
{
"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. |
Price-changing fields get 400: 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.
Other unknown fields are dropped. Body: at most 256 KiB. Prompts get the chat content check.
Response#
Each item of data has url or b64_json. Download what you keep; links have no promised lifetime.
Billing#
n × $0.0102 is reserved; only images returned are charged. A disconnect does not cancel the request.