← Help Center

API Reference

Arli AI REST API documentation

Base URL

Direct Arli API: https://api.arliai.com

Proxy (no key needed): https://generate.kim8.s4s.host/api

Image endpoints on the proxy map to Arli's /sdapi/v1/ prefix (e.g., /api/txt2img/sdapi/v1/txt2img). Text endpoints map to /v1/.

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Image generation endpoints use ARLI_IMAGE_KEY. Text/chat endpoints use ARLI_TEXT_KEY.

POST /v1/txt2img

Generate images from a text prompt.

ParameterTypeRequiredDescription
sd_model_checkpointstringNoModel name (use GET /sdapi/v1/sd-models)
promptstringYesText description of the desired image
negative_promptstringNoElements to exclude from the image
stepsintegerNoDenoising steps (1-150, default: 30)
sampler_namestringNoSampling method (default: "Euler a")
widthintegerNoImage width (64-2048, default: 1024)
heightintegerNoImage height (64-2048, default: 1024)
seedintegerNoRandom seed (-1 for random)
cfg_scalefloatNoClassifier free guidance (1-20, default: 7.0)
batch_sizeintegerNoNumber of images (1-4, default: 1)

Example

curl -X POST https://api.arliai.com/v1/txt2img \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_IMAGE_KEY" \
  -d '{
    "prompt": "a sunset over mountains, photorealistic",
    "negative_prompt": "blurry, low quality",
    "steps": 30,
    "sampler_name": "Euler a",
    "width": 1024,
    "height": 1024,
    "cfg_scale": 7.0
  }'

Response

{
  "images": ["iVBORw0KGgoAAAANSUhEUg... (base64)"],
  "info": "..."
}

POST /v1/img2img

Transform an existing image using a text prompt.

ParameterTypeRequiredDescription
init_imagesarrayYesArray of base64-encoded source images
promptstringYesText description of the transformation
negative_promptstringNoElements to exclude
stepsintegerNoDenoising steps (default: 30)
sampler_namestringNoSampling method
denoising_strengthfloatNoHow much to transform (0-1, default: 0.75)
widthintegerNoOutput width (default: 1024)
heightintegerNoOutput height (default: 1024)
seedintegerNoRandom seed (-1 for random)
cfg_scalefloatNoClassifier free guidance (default: 7.0)
maskstringNoBase64 mask image (white = keep original)

Example

curl -X POST https://api.arliai.com/v1/img2img \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_IMAGE_KEY" \
  -d '{
    "init_images": ["BASE64_IMAGE_HERE"],
    "prompt": "turn into a watercolor painting",
    "denoising_strength": 0.75,
    "steps": 30
  }'

POST /v1/upscale-img

Upscale an image using a selected upscaler model.

ParameterTypeRequiredDescription
imagestringYesBase64-encoded image to upscale
upscaler_1stringNoUpscaler model name (use GET /v1/upscalers)

Example

curl -X POST https://api.arliai.com/v1/upscale-img \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_IMAGE_KEY" \
  -d '{
    "image": "BASE64_IMAGE_HERE",
    "upscaler_1": "RealESRGAN_x4plus"
  }'

POST /v1/chat/completions

OpenAI-compatible chat completions (text generation). Supports vision with base64 images.

ParameterTypeRequiredDescription
modelstringYesModel ID (use GET /v1/models)
messagesarrayYesChat messages array
temperaturefloatNoSampling temperature
max_tokensintegerNoMax tokens to generate

Vision Example

{
  "model": "gpt-4o",
  "messages": [{
    "role": "user",
    "content": [
      {"type": "text", "text": "Describe this image"},
      {"type": "image_url", "image_url": {"url": "data:image/png;base64,BASE64_HERE"}}
    ]
  }]
}

Note Vision supports base64 images only (not URLs).

GET Endpoints

EndpointAuthDescription
GET /v1/modelsText KeyList available text/chat models
GET /sdapi/v1/sd-modelsImage KeyList available image generation models (array of name strings)
GET /v1/img-samplersImage KeyList available samplers
GET /v1/upscalersImage KeyList available upscaler models
GET /v1/img-optionsImage KeyGet current image generation options

Error Codes

CodeDescription
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
404Not found — endpoint or model not found
429Rate limited — too many requests
500Internal server error
502Upstream error — Arli API returned an error

Rate Limits

Maximum 6 parallel requests. Exceeding this will return HTTP 429.

Request timeout: 300 seconds for image generation, 30 seconds for listing endpoints.