Circles
Sign in
✦ DEVELOPER

API reference

A small OpenAI-compatible image API. Change the base URL and API key, then use the image generation endpoint you already know.

Capabilities follow each modelModels, prices, ratios, output tiers, and reference-image support come from the active provider configuration.

Base information

Base URL
AuthenticationAuthorization: Bearer <key>
Retry safetyIdempotency-Key: <unique-id>
API keyYOUR_API_KEY

Idempotency-Key is supported by both image generation and image edit requests.

No key yet? Generate one in Account → API key.

Endpoints

GET/v1/modelsList models
GET/v1/user/balanceGet balance
POST/v1/images/generationsCreate images
01

Quickstart

Your first request only needs a model, a prompt, and your API key.

cURL
curl /images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: image-request-001" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MonaLisa-v1",
    "prompt": "a quiet glass house beside a lake at dawn",
    "size": "1024x1024",
    "n": 1
  }'
02

Model and pricing

The values below are read from this server, so the docs stay in sync with the active channel.

Loading current model…
03

Request body

POST /v1/images/generations

FieldTypeRequiredDescription
modelstringYesPublic model ID returned by /v1/models.
promptstringYesWhat you want to see, up to 8,000 characters.
sizestringNoA published width×height value. When omitted, the model's default size is used; legacy values without quality are mapped to the closest supported tier.
qualitystringNoOne of the quality IDs published by the model. It is billed independently from size.
nintegerNoNumber of images, from 1 to 4, default 1.

Recommended size values

1:11024x1024
3:21200x800
16:91280x720
2:3800x1200
9:16720x1280

Use a unique Idempotency-Key for each logical generation. Retrying the same body with the same key returns the saved result without charging or calling the provider again; reusing it with different parameters returns HTTP 409.

Use GET /v1/models first. The administrator controls which public model IDs are available; pricing and provider mappings remain server-side.

04

Generation lifecycle

The Studio tracks queued and processing jobs until the active provider returns a final result.

Queue and progressQueued, processing, partial, completed, failed, and cancelled states stay visible in the Studio.
CancelQueued work is cancelled immediately and refunded. Work that already started follows the upstream charged state.
Durable recoveryAccepted asynchronous tasks are reconciled after browser reconnects or service restarts without submitting them twice.

Live preview frames and upstream session resume are shown only when an active provider supports them. Standard and asynchronous OpenAI-compatible routes still expose queue and task progress.

05

Platform limits and configuration

These values describe the live service contract, not a browser timeout.

Image concurrencyLoading runtime capacity…
Persistent queueLoading queue limit…
Preview and retentionPreview links expire after 30 minutes. Finished files remain downloadable for 7 days, then cleanup removes them.
Three Epay routesAdministrators can configure up to three encrypted Epay gateways. Enabled routes are selected by payment method and priority; merchant secrets never reach the browser.

Resolution mapping example

Paste this JSON into the model's Provider sizes field in the admin console. The public Studio then shows only sizes valid for the selected ratio and tier.

size_map
{
  "1:1": {
    "low": "1024x1024",
    "medium": "2048x2048",
    "high": "4096x4096"
  },
  "16:9": {
    "low": "1536x864",
    "medium": "2048x1152",
    "high": "4096x2304"
  }
}

Use the exact quality IDs configured for that model. A size is accepted only when its width and height match the declared ratio; invalid mappings are rejected when saved.

06

Examples

The response uses the same data[0].url shape as OpenAI image generation.

Python · openai
from openai import OpenAI
from pathlib import Path
import requests

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="",
)

result = client.images.generate(
    model="MonaLisa-v1",
    prompt="a quiet glass house beside a lake at dawn",
    size="1024x1024",
    n=1,
)

image = requests.get(result.data[0].url, timeout=60)
image.raise_for_status()
Path("result.webp").write_bytes(image.content)
07

Responses and billing

Finished images are copied to this server before the API responds.

200 JSON
{
  "created": 1787980800,
  "data": [
    { "url": "https://your-domain.example/media/outputs/...webp" }
  ]
}
Credits are reserved firstThe request is rejected with 402 when the account cannot cover the full batch.
Failed images are refundedIf a batch only finishes some images, completed images stay charged and the unfinished portion is refunded.
URLs point to saved outputThe temporary upstream URL is downloaded immediately, so callers receive a stable URL from this deployment.
Keep output URLs privateSaved output links act as bearer URLs: anyone with a link can read that image. Do not post them publicly.

Errors

400Invalid model, size, prompt, or count
401Missing or invalid API key
402Not enough credits
409Idempotency key conflict or request still running
501Image editing is not supported
502The upstream generation failed
503Generation is paused