Base information
Authorization: Bearer <key>Idempotency-Key: <unique-id>YOUR_API_KEYIdempotency-Key is supported by both image generation and image edit requests.
No key yet? Generate one in Account → API key.
A small OpenAI-compatible image API. Change the base URL and API key, then use the image generation endpoint you already know.
Authorization: Bearer <key>Idempotency-Key: <unique-id>YOUR_API_KEYIdempotency-Key is supported by both image generation and image edit requests.
No key yet? Generate one in Account → API key.
/v1/modelsList models/v1/user/balanceGet balance/v1/images/generationsCreate images/v1/images/editsEdit from references/v1/videosCreate video job/v1/videos/{id}Get video status/v1/videos/{id}/contentDownload videoYour first request only needs a model, a prompt, and your API key.
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
}'The values below are read from this server, so the docs stay in sync with the active channel.
POST /v1/images/generations
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Public model ID returned by /v1/models. |
prompt | string | Yes | What you want to see, up to 8,000 characters. |
size | string | No | A published width×height value. When omitted, the model's default size is used; legacy values without quality are mapped to the closest supported tier. |
quality | string | No | One of the quality IDs published by the model. It is billed independently from size. |
n | integer | No | Number of images, from 1 to 4, default 1. |
1024x10241200x8001280x720800x1200720x1280Use 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.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | A public model marked with reference-image support below. |
prompt | string | Yes | Editing instructions, up to 8,000 characters. |
image | file, repeatable | Yes | One or more bitmap reference files. Repeat the image field up to the model limit. |
size | string | No | Requested output size. Default: 1024x1024. |
Send multipart/form-data. This endpoint creates one output image and does not accept n. Use a unique Idempotency-Key for each logical edit; retrying with the same fields and identical reference files reuses the completed result without another charge, while changing any input returns HTTP 409.
The Studio tracks queued and processing jobs until the active provider returns a final result.
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.
These values describe the live service contract, not a browser timeout.
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.
{
"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.
The response uses the same data[0].url shape as OpenAI image generation.
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)const response = await fetch("/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "image-request-001",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "MonaLisa-v1",
prompt: "a quiet glass house beside a lake at dawn",
size: "1024x1024",
n: 1
})
});
const result = await response.json();
console.log(result.data[0].url);curl /models \ -H "Authorization: Bearer YOUR_API_KEY"
curl /user/balance \ -H "Authorization: Bearer YOUR_API_KEY"
Finished images are copied to this server before the API responds.
{
"created": 1787980800,
"data": [
{ "url": "https://your-domain.example/media/outputs/...webp" }
]
}400Invalid model, size, prompt, or count401Missing or invalid API key402Not enough credits409Idempotency key conflict or request still running501Image editing is not supported502The upstream generation failed503Generation is pausedCreate a job, poll its status, then download the saved result with the same API key.
POST /v1/videos
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | A video model ID returned by GET /v1/models. |
prompt | string | Yes | Video instructions, up to 8,000 characters. |
seconds | integer or string | No | One of the durations published by the selected model. Default: 4. |
size | string | No | An exact resolution published by the model; the first supported size is used by default. |
aspect_ratio | string | No | Selects a matching published size. The aspectRatio alias is also accepted. |
quality | string | No | One of the quality IDs published by the model. |
fps | integer | No | One of the frame rates published by the model, when restricted. |
Use one Idempotency-Key per logical video. Repeating the same key and body returns the existing job; changing any video parameter with that key returns HTTP 409.
{
"id": "video_job_id",
"object": "video",
"status": "queued | in_progress | completed | failed | cancelled",
"progress": 0,
"model": "",
"seconds": "4",
"size": "1280x720",
"quality": "standard",
"content_url": "https://your-domain.example/v1/videos/video_job_id/content",
"error": null
}Compatibility is intentionally narrow: the configured provider must accept POST /videos and expose GET /videos/{id}. Vendor-specific paths, signatures, callbacks, request fields, or cancellation APIs require a dedicated adapter.