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.

SizePer 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.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"
  }'
Python
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")
Response
{
  "created": ‹unix time›,
  "data": [
    {
      "url": "‹link to the image›"
    }
  ]
}

Request parameters#

FieldTypeNotes
modelstring, requiredwai-illustrious-sdxl
promptstring, requiredNot empty; at most 3,000 characters.
ninteger1 to 4. Default 1.
sizestringOne of the sizes above. Default 1024x1024.
response_formatstringurl (default) or b64_json.
seedinteger ≥ 0For repeatable results.
qualitystringOnly 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.