Authentication

Create an API key in the console and send it as a Bearer token. Keys are scoped to one workspace (personal or team) and are shown only once at creation. Generation requests should also carry a unique Idempotency-Key (8–128 characters) — retrying with the same key never double-charges.

Authorization: Bearer arta_live_...
Idempotency-Key: request-20260718-001

Quickstart

Submit a job, then poll it until it reaches a terminal status. Every model on the catalog accepts the same envelope — model + prompt plus model-specific options documented on each model page and in GET /v1/models/{model}.

1 · Create a job

curl -X POST "https://api.artany.ai/v1/images/generations" \
  -H "Authorization: Bearer $ARTANY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: demo-$(date +%s)" \
  -d '{"model": "artany-z-image-turbo", "prompt": "a lighthouse at dawn, watercolor"}'

2 · Poll until it finishes

curl "https://api.artany.ai/v1/jobs/{jobId}" \
  -H "Authorization: Bearer $ARTANY_API_KEY"

# => {
#   "id": "...",
#   "object": "generation.job",
#   "model": "artany-z-image-turbo",
#   "status": "succeeded",
#   "output": { "urls": ["https://cdn.artany.ai/results/..."] },
#   "billing": { "estimated_credits": "18", "charged_credits": "18", "state": "settled" }
# }

Poll every 2–3 seconds while a job is queued or running. Output URLs are served from our CDN and remain stable. Ready-to-paste cURL, Python, and Node samples ship on every model page.

Python example

import os, time, requests

base = "https://api.artany.ai"
headers = {
  "Authorization": f"Bearer {os.environ['ARTANY_API_KEY']}",
  "Content-Type": "application/json",
  "Idempotency-Key": "my-unique-request-id",
}
job = requests.post(
  f"{base}/v1/images/generations",
  headers=headers,
  json={"model": "artany-z-image-turbo", "prompt": "a lighthouse at dawn"},
).json()

while job["status"] in ("queued", "running"):
  time.sleep(2)
  job = requests.get(f"{base}/v1/jobs/{job['id']}", headers=headers).json()

print(job["status"], job.get("output"))

Job lifecycle

queued → running → succeeded | failed | canceled

  1. On submit, the maximum charge for the request is quoted and frozen from your balance.
  2. The job runs asynchronously; poll GET /v1/jobs/{jobId} for status.
  3. On success, the fixed catalog price is settled and any unused frozen amount is refunded.
  4. On failure or cancellation, the full frozen amount is refunded automatically.

Endpoints

Base URL: https://api.artany.ai/v1

GET/v1/modelsList public models available to the API key.
GET/v1/models/{model}Read the public schema, defaults, and a sample request for one model.
POST/v1/credits/estimateQuote estimated and maximum Credits before generation.
GET/v1/credits/balanceRead the workspace Credits balance and frozen amount.
GET/v1/credits/transactionsRead the workspace credit ledger.
POST/v1/images/generationsCreate a text-to-image job.
POST/v1/images/editsCreate an image-editing job.
POST/v1/videos/generationsCreate text, image, or reference video jobs.
POST/v1/videos/editsCreate a video-editing job.
GET/v1/jobs/{jobId}Read job status, output, and final Credit settlement.

Credits & billing

1 Credit = $0.01. Every model lists a fixed Credit price per configuration (resolution, duration, output count…) on the pricing page — the listed price is exactly what a successful run settles for. Use POST /v1/credits/estimate to quote a request before submitting, and GET /v1/credits/transactions to reconcile the ledger. Credits never expire and there is no subscription.

Errors

Errors return an error object with code, message, request_id, and an optional param. Include the request id when contacting support.

CodeHTTPMeaning
AUTHENTICATION_REQUIRED401Missing or invalid API key.
KEY_SCOPE_FORBIDDEN403The key is not allowed to perform this action.
MODEL_NOT_FOUND404The model id is not in the public catalog.
INVALID_REQUEST400A parameter is missing or outside the model schema.
INSUFFICIENT_CREDITS402Balance is below the maximum charge for this job.
RATE_LIMITED429Too many requests — retry with backoff.
INTERNAL500Unexpected server error; safe to retry with the same Idempotency-Key.