• Dashboard
  • Models
  • Apps
  • Documentation
  • Pricing
Account
  • API keys
  • Analytics
  • Logs
  • Assets
  • Billing
  • Contact sales
  • Status

Documentation

How to send requests to the ImagineArt API and handle what comes back.

IntroductionQuickstartAuthenticationModelsUploadsGenerationsAppsUsage and billingErrorsRate limitsEndpoint reference
On this pageIntroductionQuickstartAuthenticationModelsUploadsGenerationsAppsUsage and billingErrorsRate limitsEndpoint reference

Introduction

The ImagineArt API generates images and videos with ImagineArt models, runs creator-built Apps, and reports usage per key.

  • Base URLhttps://api.imagine.art/v1
  • AuthAPI key as a Bearer token
  • FormatJSON over HTTPS
  • GenerationAsynchronous: submit, then poll
  • Rate limit1,000 POST and 200 GET requests / min per organization
At a glance
Base URLhttps://api.imagine.art/v1
AuthAPI key as a Bearer token
FormatJSON over HTTPS
GenerationAsynchronous: submit, then poll
Rate limit1,000 POST and 200 GET requests / min per organization

Successful responses wrap their payload in data; lists add pagination.

{ "status": "success", "data": { } }

Quickstart

Three steps take you from a new key to a finished image.

1. Get a key

Create a key under API keys. Keep it on your server, never in browser or app code.

export IMAGINE_API_KEY="your-api-key"

2. Submit a generation

curl
curl -X POST https://api.imagine.art/v1/image/generate \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagineart-2.0",
    "input": {
      "prompt": "A red convertible above Cinque Terre at golden hour",
      "aspect_ratio": "16:9"
    }
  }'

The API answers 202 at once with an id and data.status set to pending.

3. Poll until it finishes

curl
curl https://api.imagine.art/v1/generations/{id}/status \
  -H "Authorization: Bearer $IMAGINE_API_KEY"
Response · 200
{
  "status": "success",
  "data": {
    "id": "9e9f558c-4b4e-40fd-b67e-8617906c2cd1",
    "status": "completed",
    "images": [{ "url": "https://cdn.imagine.art/..." }]
  }
}

Authentication

Every request except GET /models and GET /cost needs your key as a Bearer token. Those two work without one, but list only public models; send your key to also see models granted to your organization.

Authorization: Bearer $IMAGINE_API_KEY

A key belongs to one organization and spends its credits. The secret is shown once, when you create it; after that only a short preview is visible.

Credit limits

Give each key a credit cap that resets on a schedule, so one integration can’t drain the balance. A request past the cap fails with 402, code 1210.

  • credit_limitinteger | nullCredits per period; null means no cap
  • credit_limit_periodstringmonthly, quarterly or yearly
  • credits_usedintegerSpent in the current period
  • credits_reset_atISO 8601When credits_used resets to 0
  • expires_atISO 8601 | nullWhen the key stops working; null means never
FieldTypeMeaning
credit_limitinteger | nullCredits per period; null means no cap
credit_limit_periodstringmonthly, quarterly or yearly
credits_usedintegerSpent in the current period
credits_reset_atISO 8601When credits_used resets to 0
expires_atISO 8601 | nullWhen the key stops working; null means never

Manage keys

curl
curl -X POST https://api.imagine.art/v1/keys \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Backend",
    "credit_limit": 50000,
    "credit_limit_period": "monthly"
  }'

The secret is in data.key. Use GET /keys to list, PATCH /keys/{id} to rename or change the limit, and DELETE /keys/{id} to revoke.

Models

Pass the model ID as model in the generate request. Each model’s page has its full input schema and an llms.txt for agents.

  • imagineart-frame-1.0video/video/generate$0.035/ s
  • imagineart-2.0image/image/generate$0.045/ img
  • imagineart-image-enhanceimage/image/generatefrom$0.03/ img
  • imagineart-1.5image/image/generate$0.03/ img
  • imagineart-2.0-editimage/image/generate$0.075/ img
  • z-image-turboimage/image/generate$0.015/ img
  • imagineart-1.5-proimage/image/generate$0.075/ img
  • imagineart-video-upscalevideo/video/generate$0.012/ s
Model IDTypeEndpointPrice
imagineart-frame-1.0video/video/generate$0.035/ s
imagineart-2.0image/image/generate$0.045/ img
imagineart-image-enhanceimage/image/generatefrom$0.03/ img
imagineart-1.5image/image/generate$0.03/ img
imagineart-2.0-editimage/image/generate$0.075/ img
z-image-turboimage/image/generate$0.015/ img
imagineart-1.5-proimage/image/generate$0.075/ img
imagineart-video-upscalevideo/video/generate$0.012/ s

List models

GET /models returns each model’s inputs: type, whether it’s required, length limits and allowed values. Page with limit and cursor. The list depends on the key: some models are open only to organizations granted them, and an invalid key gets 401.

Response · one model
{
  "id": "imagineart-1.5",
  "type": "image",
  "inputs": [
    { "name": "prompt", "kind": "string", "required": true, "max_length": 2000 },
    { "name": "aspect_ratio", "kind": "enum", "values": ["1:1", "16:9", "9:16"] }
  ],
  "outputs": [{ "name": "images", "kind": "images" }]
}

Input kinds

  • stringJSON stringmin_length, max_length
  • enumJSON string, one of valuesvalues
  • intJSON integermin, max
  • boolJSON true or falseNone
  • urlJSON string, an https URLmax_length
KindValue in inputLimits returned
stringJSON stringmin_length, max_length
enumJSON string, one of valuesvalues
intJSON integermin, max
boolJSON true or falseNone
urlJSON string, an https URLmax_length

Prices

GET /cost returns each model’s base price and the factors that multiply it, such as aspect ratio or resolution. Send your key to include granted models; a base of 0 means the model is free.

URL inputs

Inputs like image_url, video_url and audio_url take a URL, not the file itself. It must be https, at most 2,048 characters, without credentials, on a public host (not localhost or a private IP), and stay valid until the generation completes. For a local file, upload it as an asset and pass its URL.

Uploads

Upload images, videos and audio up to 100 MB to get a public URL you can pass to any URL input. An upload takes three requests: create it, send the bytes, then wait until it's processed. List them anytime with GET /assets/files.

1. Create the upload

  • content_typestringRequired. An image/*, video/* or audio/* MIME type, e.g. image/png
  • content_lengthintegerRequired. The file size in bytes, 1 to 104,857,600 (100 MB)
FieldTypeDescription
content_typestringRequired. An image/*, video/* or audio/* MIME type, e.g. image/png
content_lengthintegerRequired. The file size in bytes, 1 to 104,857,600 (100 MB)
curl
curl -X POST https://api.imagine.art/v1/assets/files/uploads \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content_type": "image/png", "content_length": 482133 }'
Response · 201
{
  "status": "success",
  "data": {
    "id": "6f1c2a9e-3d4b-4e8f-9a17-2b5c8d0e4f61",
    "type": "image",
    "upload_url": "https://….r2.cloudflarestorage.com/unprocessed/6f1c2a9e-3d4b-4e8f-9a17-2b5c8d0e4f61?X-Amz-…",
    "content_type": "image/png",
    "content_length": 482133
  }
}

2. Send the file

PUT the raw bytes to upload_url within 5 minutes, with the same Content-Type and exactly content_length bytes. It's a signed storage URL, so don't send your API key with it.

curl
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png

3. Wait until it's processed

Poll every 2 seconds until data.status is finished, usually within 30 seconds. Then use https://asset.imagine.art/processed/{id} as the input URL. While a file is still processing the status can briefly answer 500; keep polling for up to a minute.

  • pendingNoUploaded and being processed
  • finishedYesServed at its asset URL
data.statusFinalMeaning
pendingNoUploaded and being processed
finishedYesServed at its asset URL
curl
curl https://api.imagine.art/v1/assets/files/{id}/status \
  -H "Authorization: Bearer $IMAGINE_API_KEY"
Response · 200
{
  "status": "success",
  "data": {
    "id": "6f1c2a9e-3d4b-4e8f-9a17-2b5c8d0e4f61",
    "type": "image",
    "status": "finished",
    "metadata": {
      "type": "image",
      "mime_type": "image/png",
      "format_type": ".png",
      "file_size": 482133,
      "width": 1024,
      "height": 1024,
      "has_audio": false
    }
  }
}

Full example

Python
import mimetypes, os, time, requests

API = "https://api.imagine.art/v1"
headers = {"Authorization": f"Bearer {os.environ['IMAGINE_API_KEY']}"}
path = "photo.png"
content_type = mimetypes.guess_type(path)[0]

# 1. Create the upload
response = requests.post(f"{API}/assets/files/uploads", headers=headers, json={
    "content_type": content_type,
    "content_length": os.path.getsize(path),
})
response.raise_for_status()
upload = response.json()["data"]

# 2. Upload the bytes, with the same Content-Type
with open(path, "rb") as file:
    requests.put(
        upload["upload_url"], data=file, headers={"Content-Type": content_type}
    ).raise_for_status()

# 3. Wait until it's processed, usually 10 to 30 seconds
for _ in range(30):
    time.sleep(2)
    response = requests.get(f"{API}/assets/files/{upload['id']}/status", headers=headers)
    response.raise_for_status()
    status = response.json()["data"]["status"]
    if status == "error":
        raise RuntimeError(f"Asset {upload['id']} could not be processed")
    if status == "finished":
        break
else:
    raise TimeoutError("The asset is still processing after a minute")

image_url = f"https://asset.imagine.art/processed/{upload['id']}"
JavaScript
import { readFile } from "node:fs/promises";

const API = "https://api.imagine.art/v1";
const headers = { Authorization: `Bearer ${process.env.IMAGINE_API_KEY}` };
const contentType = "image/png";
const file = await readFile("photo.png");

// 1. Create the upload
const created = await fetch(`${API}/assets/files/uploads`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ content_type: contentType, content_length: file.byteLength }),
});
if (!created.ok) throw new Error(await created.text());
const { data: upload } = await created.json();

// 2. Upload the bytes, with the same Content-Type
const uploaded = await fetch(upload.upload_url, {
  method: "PUT",
  headers: { "Content-Type": contentType },
  body: file,
});
if (!uploaded.ok) throw new Error(await uploaded.text());

// 3. Wait until it's processed, usually 10 to 30 seconds
let status = "pending";
for (let attempt = 0; attempt < 30 && status === "pending"; attempt += 1) {
  await new Promise((resolve) => setTimeout(resolve, 2000));
  const response = await fetch(`${API}/assets/files/${upload.id}/status`, { headers });
  if (!response.ok) throw new Error(await response.text());
  ({ status } = (await response.json()).data);
}
if (status !== "finished") throw new Error(`Asset ${upload.id} is ${status}`);

const imageUrl = `https://asset.imagine.art/processed/${upload.id}`;

List and delete

GET /assets/files lists uploads, newest first; page with limit (1 to 100, default 20) and cursor. DELETE /assets/files/{id} removes an upload, and its URL stops working.

curl
curl "https://api.imagine.art/v1/assets/files?limit=20" \
  -H "Authorization: Bearer $IMAGINE_API_KEY"
Response · 200
{
  "status": "success",
  "data": [
    { "id": "6f1c2a9e-3d4b-4e8f-9a17-2b5c8d0e4f61", "type": "image", "created_at": "2026-11-23T05:16:53Z" }
  ],
  "pagination": { "limit": 20, "has_more": false, "next_cursor": null }
}
curl
curl -X DELETE https://api.imagine.art/v1/assets/files/{id} \
  -H "Authorization: Bearer $IMAGINE_API_KEY"
Response · 200
{ "status": "success", "data": { "id": "6f1c2a9e-3d4b-4e8f-9a17-2b5c8d0e4f61", "deleted": true } }

Errors

A type that isn't image, video or audio, or a size over 100 MB, fails with 400, code 1100. An unknown id returns 404, code 1107.

Response · 400
{
  "status": "error",
  "code": 1100,
  "error": "The sent request is invalid.",
  "message": "content_type must be an image, video or audio MIME type"
}

Generations

POST /image/generate and POST /video/generate return 202 with a pending generation. Poll GET /generations/{id}/status until it ends.

Request body

  • modelstringRequired. A model ID from GET /models
  • inputobjectRequired. Only the inputs GET /models lists for the model; any other field is a 400
FieldTypeDescription
modelstringRequired. A model ID from GET /models
inputobjectRequired. Only the inputs GET /models lists for the model; any other field is a 400

Status

  • pendingNoQueued
  • processingNoRunning
  • completedYesOutputs are ready in images or videos
  • failedYesEvery attempt failed, and the credits are refunded
data.statusFinalMeaning
pendingNoQueued
processingNoRunning
completedYesOutputs are ready in images or videos
failedYesEvery attempt failed, and the credits are refunded

The top-level status is about your HTTP request; data.status is the generation’s progress.

Polling

Poll every 3 seconds for images and 5 for video, and stop after about 10 minutes. Polls count toward the rate limit; on 429, wait Retry-After seconds.

Python
import os, time, requests

API = "https://api.imagine.art/v1"
headers = {"Authorization": f"Bearer {os.environ['IMAGINE_API_KEY']}"}

generation = requests.post(f"{API}/image/generate", headers=headers, json={
    "model": "imagineart-2.0",
    "input": {"prompt": "A red convertible above Cinque Terre"},
}).json()["data"]

while generation["status"] not in ("completed", "failed"):
    time.sleep(3)
    response = requests.get(f"{API}/generations/{generation['id']}/status", headers=headers)
    if response.status_code == 429:
        time.sleep(int(response.headers.get("Retry-After", 3)))
        continue
    generation = response.json()["data"]

print(generation["images"])

History

GET /generations lists past generations, newest first. Filter by model or status; page with limit and cursor. Output URLs are signed and valid for 166 hours, so download the outputs you want to keep. A generation that fails upstream is retried up to 3 times under the same id and charged once.

Apps

Apps are multi-step pipelines built by creators on ImagineArt. You run an App with one request and poll it like a generation. Browse them under Apps.

1. Find an App

GET /flow/app/ lists public Apps; add scope=mine for your own. GET /flow/app/{id} returns one App by its id.

Response · data
{
  "id": "app_8c1f...",
  "name": "Product shot to ad",
  "base_cost": 2916,
  "monetization": "low",
  "inputs": [
    { "id": "in_1", "handle": "imageUrl", "node_id": "n_3", "node_type": "ImageUpload" }
  ]
}

2. Run it

Send each input back with a value.

curl
curl -X POST https://api.imagine.art/v1/flow/app/run \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "app_8c1f...",
    "execution_count": 1,
    "inputs": [
      { "id": "in_1", "handle": "imageUrl", "node_id": "n_3", "node_type": "ImageUpload",
        "value": "https://example.com/bottle.png" }
    ]
  }'

3. Poll the run

GET /flow/app/{task_id}/status returns the run’s status and outputs. A finished output’s URL is at outputs[].content.<type>.content. GET /flow/app/{app_id}/results lists past runs.

4. Create your own App

POST /flow/app creates an App from a workflow graph in one request. Send the graph’s nodes and edges (the shape GET /flow/app/{id}/graph returns), the inputs people fill in and a parameters entry for each. inputs, parameters, input_presets and base_cost are required, even if empty. Apps you create can be deleted with DELETE /flow/app/{id} but not edited yet.

curl
curl -X POST https://api.imagine.art/v1/flow/app \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Photo Upscaler",
    "slug": "photo-upscaler-a1b2c3",
    "description": "Upscales a photo 2x.",
    "graph": {
      "nodes": [{ "id": "n1", "type": "upscale-image", "data": { … } }],
      "edges": []
    },
    "inputs": [
      { "id": "in1", "name": "", "description": "", "handle": "imageUrl",
        "node_id": "n1", "node_type": "upscale-image" }
    ],
    "parameters": [
      { "id": "in1", "type": "image", "label": "Photo", "required": true,
        "order": 0, "default": "", "options": [], "limit": 1, "version": 2 }
    ],
    "input_presets": [],
    "base_cost": 20
  }'

Pricing

A run costs base_cost plus the creator fee for the App’s monetization tier.

  • none0
  • low10
  • medium20
  • high30
monetizationCreator fee (credits)
none0
low10
medium20
high30

Usage and billing

You pay when a generation is accepted. Invalid requests are free, and generations that fail are refunded. The API counts in credits, and one credit is $0.003. Every usage endpoint takes range: today, 24h, 7d or 30d.

  • GET /usage/balanceRemaining credits—
  • GET /usage/summaryRequests, successes, failures, credits and success rate, compared with the previous periodapi_key_id, model
  • GET /usage/timeseriesThe same totals per bucket; interval is 15m, 30m, 1h or 1dapi_key_id, model
  • GET /usage/modelsTotals per modelapi_key_id
  • GET /usage/keysTotals per key, with each key’s limit and reset datemodel
EndpointReturnsFilters
GET /usage/balanceRemaining credits—
GET /usage/summaryRequests, successes, failures, credits and success rate, compared with the previous periodapi_key_id, model
GET /usage/timeseriesThe same totals per bucket; interval is 15m, 30m, 1h or 1dapi_key_id, model
GET /usage/modelsTotals per modelapi_key_id
GET /usage/keysTotals per key, with each key’s limit and reset datemodel

GET /logs has one row per request: status, HTTP code, credits, closing balance, key and model. GET /audit-logs records account actions such as creating or revoking a key. Both page with limit and cursor.

Errors

Errors return status: "error", a numeric code and a readable message.

{ "status": "error", "code": 1000, "message": "The bearer token is missing from the header." }
  • 400Invalid body, unknown model or field, or missing keyNo
  • 401Invalid, revoked or expired keyNo
  • 402Out of credits, or the key reached its limit (code 1210)After a top-up or reset
  • 404Generation or asset not found in your organization (code 1107 for assets)No
  • 410Model disabledNo
  • 429Rate limit reached (1,000 POST and 200 GET requests / min per organization)After Retry-After seconds
  • 422Prompt rejected by the content filter (Z-Image)No
  • 451Prompt rejected (image models)No
  • 500Server or upstream failureYes, with backoff
HTTPMeaningRetry
400Invalid body, unknown model or field, or missing keyNo
401Invalid, revoked or expired keyNo
402Out of credits, or the key reached its limit (code 1210)After a top-up or reset
404Generation or asset not found in your organization (code 1107 for assets)No
410Model disabledNo
429Rate limit reached (1,000 POST and 200 GET requests / min per organization)After Retry-After seconds
422Prompt rejected by the content filter (Z-Image)No
451Prompt rejected (image models)No
500Server or upstream failureYes, with backoff

A generation that fails after it starts isn’t an HTTP error: it ends with data.status = failed.

Rate limits

  • POST, PUT, PATCH1,000 per minute per organization
  • GET200 per minute per organization
RequestsLimit
POST, PUT, PATCH1,000 per minute per organization
GET200 per minute per organization

Status polls are GET requests, so they count toward the GET limit. Past the limit you get 429 with a Retry-After header. Need more? Contact sales and we’ll raise it for your organization.

Endpoint reference

Paths are relative to https://api.imagine.art/v1.

  • GET/modelsModels and their inputs (key optional)
  • GET/costModel prices (key optional)
  • POST/image/generateStart an image
  • POST/video/generateStart a video
  • GET/generations/{id}/statusCheck a generation
  • GET/generationsList generations
  • POST/assets/files/uploadsStart a file upload
  • GET/assets/files/{id}/statusCheck an upload
  • GET/assets/filesList uploads
  • DELETE/assets/files/{id}Delete an upload
  • GET/flow/app/List apps
  • GET/flow/app/{id}Get an app
  • GET/flow/app/{id}/graphGet an app’s workflow graph
  • POST/flow/appCreate an app from a graph
  • DELETE/flow/app/{id}Delete an app you created
  • POST/flow/app/runRun an app
  • GET/flow/app/{task_id}/statusCheck an app run
  • GET/flow/app/{app_id}/resultsList an app’s runs
  • GET/keysList keys
  • POST/keysCreate a key
  • PATCH/keys/{id}Update a key
  • DELETE/keys/{id}Revoke a key
  • GET/usage/balanceCredit balance
  • GET/usage/summaryTotals for a period
  • GET/usage/timeseriesTotals over time
  • GET/usage/modelsTotals per model
  • GET/usage/keysTotals per key
  • GET/logsRequest log
  • GET/audit-logsAccount activity
MethodPathPurpose
GET/modelsModels and their inputs (key optional)
GET/costModel prices (key optional)
POST/image/generateStart an image
POST/video/generateStart a video
GET/generations/{id}/statusCheck a generation
GET/generationsList generations
POST/assets/files/uploadsStart a file upload
GET/assets/files/{id}/statusCheck an upload
GET/assets/filesList uploads
DELETE/assets/files/{id}Delete an upload
GET/flow/app/List apps
GET/flow/app/{id}Get an app
GET/flow/app/{id}/graphGet an app’s workflow graph
POST/flow/appCreate an app from a graph
DELETE/flow/app/{id}Delete an app you created
POST/flow/app/runRun an app
GET/flow/app/{task_id}/statusCheck an app run
GET/flow/app/{app_id}/resultsList an app’s runs
GET/keysList keys
POST/keysCreate a key
PATCH/keys/{id}Update a key
DELETE/keys/{id}Revoke a key
GET/usage/balanceCredit balance
GET/usage/summaryTotals for a period
GET/usage/timeseriesTotals over time
GET/usage/modelsTotals per model
GET/usage/keysTotals per key
GET/logsRequest log
GET/audit-logsAccount activity