# Arteza API reference

The Arteza API is a JSON REST API. You start a generation, then poll it or receive a webhook when it finishes. Every response has a request id you can quote to support.

Base URL: https://arteza.ai/api/v1
OpenAPI 3.1: https://arteza.ai/api/v1/openapi.json
Official SDKs for TypeScript and Python, a command line and agent skills: https://arteza.ai/developers/sdks

## Quickstart

1. Create an API key in the console. https://arteza.ai/developers/console/keys
2. Choose how the key pays: your plan credits, or a pay-as-you-go USD balance.
3. Send your first request.

```bash
curl https://arteza.ai/api/v1/generations \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "input": { "prompt": "A red fox in fresh snow, golden hour" }
  }'
```

The response is a generation. Images often finish within the request; video returns while still running, so poll it or use a webhook.

```json
{
  "id": "4f1c2b9e-8d6a-4c51-9a63-0f2b7d1e5a90",
  "object": "generation",
  "model": "nano-banana-2",
  "status": "completed",
  "created_at": "2026-11-28T10:00:00.000Z",
  "completed_at": "2026-11-28T10:00:07.412Z",
  "input": {
    "prompt": "A red fox in fresh snow, golden hour",
    "aspect_ratio": "1:1",
    "num_images": 1
  },
  "output": {
    "files": [
      {
        "url": "https://assets.arteza.ai/generations/4f1c2b9e.png",
        "type": "image"
      }
    ],
    "thumbnail_url": null
  },
  "error": null,
  "billing": {
    "funding": "usd",
    "usd": 0.08,
    "usd_micros": 80000,
    "refunded": false
  }
}
```

## Authentication

Send your key in the Authorization header of every request. Keys start with ark_live_ and are shown once, when you create them.

```http
Authorization: Bearer ark_live_...
```

```http
HTTP/1.1 401 Unauthorized
X-Request-Id: req_56X-0XttDr5iOugT

{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key is not valid.",
    "request_id": "req_56X-0XttDr5iOugT",
    "doc_url": "https://arteza.ai/developers/docs/errors#invalid_api_key"
  }
}
```

Keep keys on your server, never in a browser or app. If a key leaks, revoke it in the console; requests with it stop at once.

You can also lock a key to the IP addresses your servers use: in the console, open API keys and set its allowed IPs. A request from any other address is refused with 403 ip_not_allowed.

Each key can carry its own limits. When you create one in the console you can give it an expiry date and a spend limit per day, week, month or in total. A request past that limit returns 402 key_limit_exceeded, and an expired key returns 401 expired_api_key. A missing, unknown or revoked key also returns 401, so alert on that status instead of retrying. To rotate a key without downtime, create the new key, deploy it, then revoke the old one. For a browser or a mobile app, mint a short-lived client token on your server and never ship the key itself.

## Pricing and funding

Each key is funded by plan credits or by a USD balance. The two are priced differently on purpose:

| | Plan credits | Pay as you go (USD) |
|---|---|---|
| Price | Same credits as the Arteza studio | The provider's cost, no markup |
| Paid from | Your plan's credit balance | Your API balance, topped up by card |
| On each generation | billing.credits | billing.usd and billing.usd_micros |
| Failures | Credits refunded automatically | Balance refunded automatically |
| Spend limit per key | In credits, per day, week or month | In USD, per day, week or month |

The estimate endpoint and the balance endpoint always return both: the credit price with its approximate USD value on your plan, and the pay-as-you-go USD price. Top-ups add a service fee equal to the card processor's charge, shown before you pay.

A price depends on the model and on the settings you send: resolution, duration, the number of outputs and audio can all change it. The estimate endpoint returns the exact figure for a request without running it or charging anything, and it applies the same rules as the real request. The charge is taken when the generation is created and is shown in its billing object. If the balance is too low, the request returns 402 insufficient_credits or insufficient_balance before anything runs. A USD balance can refill itself: turn on auto top-up in the console, choose the amount, and the saved card is charged when the balance runs low.

## Generations

A generation runs one model on one input. These are the endpoints, relative to the base URL:

One model id covers every mode the model has, and the input you send picks the mode. A video model makes a text-to-video clip from a prompt, animates image_url as the first frame, goes from image_url to end_image_url when both are sent, and makes a reference video from two or more reference_images. Some models also take mode "extend" with video_url, or mode "structure" with a control image. GET /models/{id} lists each mode under modes, with the fields that select it and a minimal input, and the price follows the mode: POST /estimate with the same input quotes it.

Send metadata with a generation to tag it with your own ids, such as your end user or an order: up to 16 keys with string values. It comes back on the generation, in its webhooks and in GET /generations, which filters by it, for example GET /generations?metadata[user_id]=u_123.

- `/generations`
- `/generations/{id}`
- `/generations/{id}/cancel`
- `/generations/{id}/stream`
- `/events`
- `/tokens`
- `/usage`
- `/models`
- `/models/{id}`
- `/estimate`
- `/apps`
- `/apps/{id}`
- `/uploads`
- `/uploads/{id}`
- `/balance`
- `/studios`
- `/studios/jobs`
- `/studios/jobs/{id}`
- `/studios/fashion/catalog`
- `/studios/fashion/items`
- `/studios/fashion/estimate`
- `/studios/fashion/shoots`
- `/studios/influencer/catalog`
- `/studios/influencer/estimate`
- `/studios/influencer/personas`
- `/studios/influencer/looks`
- `/studios/influencer/sheets`

status is one of queued, in_progress, completed, failed or canceled. A failed or canceled generation is never charged.

## Models

Each model has an id and an input_schema in JSON Schema. Send only the fields it lists; an unknown field is rejected with unknown_parameter so a typo never silently changes your result. Omitted fields take the model's defaults.

Each model also lists its modes: text to video, image to video, first and last frame, reference to video, editing and the rest. A mode names the input fields that select it and comes with a working example, so one request tells you everything a model can do. GET /models lists every model, and each one can be read on its own with its price at the defaults.

```bash
curl https://arteza.ai/api/v1/models/seedance-2 \
  -H "Authorization: Bearer $ARTEZA_API_KEY"

{
  "id": "seedance-2",
  "object": "model",
  "category": "video",
  "modes": [
    { "id": "text_to_video", "inputs": ["prompt"] },
    { "id": "image_to_video", "inputs": ["image_url"] },
    { "id": "first_last_frame", "inputs": ["image_url", "end_image_url"] },
    { "id": "reference_to_video", "inputs": ["reference_images", "video_urls", "audio_urls"] }
  ],
  "input_schema": { "type": "object", "properties": { "prompt": {...}, "duration": {...}, ... } },
  "pricing": { "at_defaults": { "credits": { "amount": 22.8 }, "usd": { "amount": 1.512 } } }
}
```

Models and prices: https://arteza.ai/developers/models

## Estimating cost

POST /estimate takes the same model and input as a generation and returns the price in credits and in USD, the funding your key uses, and whether your balance covers it. It never runs or charges anything.

```bash
curl https://arteza.ai/api/v1/estimate \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "seedance-2", "input": {"prompt": "a fox in snow", "duration": 5}}'

{
  "object": "estimate",
  "model": "seedance-2",
  "funding": "credits",
  "affordable": true,
  "price": {
    "credits": { "amount": 22.8, "usd_equivalent": 2.28 },
    "usd": { "amount": 1.512, "basis": "unit", "unit": "1000 tokens", "quantity": 108 }
  }
}
```

The price follows the input: a longer clip, a higher resolution or more images costs more, so estimate with the exact input you are about to send. affordable tells you in advance whether the generation would be refused for balance, and the generation is priced the same way when you create it.

## Uploading files

To use a local file as an input, ask for an upload URL with its content type and size in bytes, PUT the file to it within ten minutes, then pass the returned url in your input. Images, video and audio are accepted.

```bash
curl https://arteza.ai/api/v1/uploads \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content_type": "image/png", "size": 482113 }'

# then PUT the file to upload_url with the returned headers,
# and pass "url" as image_url in a generation's input.
```

Send photos as JPEG, PNG, WebP or GIF. iPhone photos are HEIC by default: convert them on the device before uploading (on iOS, UIImage jpegData), which is also smaller to send.

## Client tokens

Never ship your API key in a mobile or web app: anyone can pull it out and spend your balance. Keep the key on your server and have it mint a client token for each session with POST /tokens. The app sends the token exactly where it would send a key.

```bash
# On your server, with the secret key:
curl https://arteza.ai/api/v1/tokens \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ttl_seconds": 900, "models": ["flux-2-max", "seedance-2"], "max_spend": 50, "user": "u_123"}'

# {"object":"client_token","token":"ark_tok_...","expires_at":"...","user":"u_123",...}

# In the app, with the token (never the key):
curl https://arteza.ai/api/v1/generations \
  -H "Authorization: Bearer ark_tok_..." \
  -H "Content-Type: application/json" \
  -d '{"model": "flux-2-max", "input": {"prompt": "a lighthouse at dusk"}}'
```

A token lives from 1 to 60 minutes (15 by default) and can be limited to a list of models or apps, capped at a spend in the key's own unit (credits, or USD for a USD key) and bound to one end user. A bound token tags every generation with metadata.user_id and only ever sees that user's generations. It spends the key's balance under the key's own limits, and stops working when it expires or the key is revoked.

A token can create, read, list, follow and cancel generations, upload files, get estimates and read the model and app catalogue. Everything else, including minting another token, needs the key and answers 403 token_not_allowed. Every endpoint answers CORS, so a browser can call it directly.

## Usage

GET /usage returns what your account spent through the API between two dates (the last 30 days by default), grouped by day, model, key or end user (metadata.user_id). Generations and studio jobs are both counted, and a failed or canceled generation counts as zero because it was refunded.

```bash
curl "https://arteza.ai/api/v1/usage?from=2026-11-01&group_by=user" \
  -H "Authorization: Bearer $ARTEZA_API_KEY"

{
  "object": "usage",
  "group_by": "user",
  "data": [
    { "user": "u_123", "requests": 42, "succeeded": 41, "failed": 1, "credits": 96.4, "usd": 0 }
  ],
  "totals": { "requests": 42, "succeeded": 41, "failed": 1, "credits": 96.4, "usd": 0 }
}
```

## Live status

GET /generations/{id}/stream sends the generation as Server-Sent Events every time its status changes and closes once it completes, fails or is canceled. Use it in an app instead of polling: a phone cannot receive a webhook, and polling spends your read rate limit. The stream ends after five minutes; open it again, or read the generation, for a longer job.

```bash
curl -N https://arteza.ai/api/v1/generations/GENERATION_ID/stream \
  -H "Authorization: Bearer $ARTEZA_API_KEY"

event: generation
data: {"id":"...","status":"in_progress",...}

event: generation
data: {"id":"...","status":"completed","output":{"files":[...]},...}

event: done
data: {"id":"...","status":"completed",...}
```

POST /generations/{id}/cancel takes a job back, with a full refund, until the provider starts running it: before dispatch, and while it waits in the provider's queue. Once it is running it is being paid for, and cancel answers 409 not_cancellable.

To follow many jobs at once, open GET /events instead: one Server-Sent Events connection that sends a generation whenever any generation on the account is created or changes status. Every event has an id; pass it back as since, or let EventSource send it as Last-Event-ID when it reconnects, and the stream replays what you missed, up to 24 hours back. The server closes the stream after about five minutes, and the SDKs reconnect on their own. A client token only sees its own end user's generations.

```text
curl -N "https://arteza.ai/api/v1/events?since=2026-12-01T09:00:00Z" \
  -H "Authorization: Bearer $ARTEZA_API_KEY"

event: ready
data: {"object":"events","since":"2026-12-01T09:00:00.000Z"}

id: 2026-12-01T09:00:04.212Z
event: generation
data: {"id":"4f1c...","status":"in_progress",...}

id: 2026-12-01T09:00:07.512Z
event: generation
data: {"id":"4f1c...","status":"completed","output":{"files":[...]},...}
```

## Webhooks

Pass webhook_url when you create a generation and we POST the final generation to it when it completes, fails or is canceled. The URL must be public HTTPS.

Every delivery is signed with your webhook secret using the Standard Webhooks scheme: the webhook-id, webhook-timestamp and webhook-signature headers. Verify the signature before trusting the body, and use webhook-id to ignore duplicates.

```js
import crypto from "node:crypto";

// secret: whsec_... from the console. body: the raw request body string.
export function verify(secret, headers, body) {
  const id = headers["webhook-id"];
  const ts = headers["webhook-timestamp"];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = crypto.createHmac("sha256", key).update(`${id}.${ts}.${body}`).digest("base64");
  return headers["webhook-signature"].split(" ").some((s) => {
    const sig = s.split(",")[1] ?? "";
    return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  });
}
```

Answer with any 2xx within ten seconds. Otherwise we retry with backoff for 24 hours. You can see every delivery and resend one from the console.

## Idempotency

Send an Idempotency-Key header when you create a generation. Repeating the request with the same key returns the original generation instead of starting and charging a second one. Reusing a key with a different body returns idempotency_conflict.

```bash
curl https://arteza.ai/api/v1/generations \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Idempotency-Key: order-1042-render" \
  -H "Content-Type: application/json" \
  -d '{"model": "flux-2-max", "input": {"prompt": "a lighthouse at dusk"}}'

# The same request again, after a timeout: the first generation comes back
HTTP/1.1 200 OK
Idempotent-Replayed: true
```

Use a value that belongs to the action, such as an order id, and send it again on every retry after a timeout or a dropped connection. A replayed response carries the Idempotent-Replayed: true header. Keys belong to your account and are kept for 24 hours; after that the same key starts a new generation.

## Errors

Errors use standard HTTP status codes and one JSON shape. code is stable and safe to branch on; message is for people. Every error links to its row below.

| code | status | message |
|---|---|---|
| `missing_api_key` | 401 | No API key was provided. Send it as `Authorization: Bearer ark_live_...`. |
| `invalid_api_key` | 401 | The API key is not valid. |
| `revoked_api_key` | 401 | This API key has been revoked. |
| `expired_api_key` | 401 | This API key has expired. |
| `ip_not_allowed` | 403 | This API key only accepts requests from its allowed IP addresses. Add this address to the key in the console, or use another key. |
| `model_not_allowed` | 403 | Your plan does not include this model. |
| `token_not_allowed` | 403 | A client token cannot call this endpoint. Call it from your server with the API key. |
| `token_model_not_allowed` | 403 | This client token is not allowed to use this model. |
| `token_spend_exceeded` | 402 | This client token has reached its spend cap. Mint a new token from your server. |
| `invalid_json` | 400 | The request body is not valid JSON. |
| `invalid_request` | 400 | The request is invalid. |
| `missing_parameter` | 400 | A required parameter is missing. |
| `invalid_parameter` | 400 | A parameter has an invalid value. |
| `unknown_parameter` | 400 | The input contains a field this model does not accept. |
| `model_not_found` | 404 | No model with this id is available on the API. |
| `model_unavailable` | 410 | This model is no longer available. |
| `generation_not_found` | 404 | No generation with this id exists on your account. |
| `upload_not_found` | 404 | No upload with this id exists on your account. |
| `not_found` | 404 | Not found. |
| `idempotency_conflict` | 409 | This Idempotency-Key was already used with a different request body. |
| `idempotency_in_progress` | 409 | A request with this Idempotency-Key is still being processed. Retry in a few seconds. |
| `generation_in_progress` | 409 | This generation is still running. Cancel it, or wait for it to finish, before deleting it. |
| `not_cancellable` | 409 | This generation has already started and can no longer be cancelled. |
| `insufficient_credits` | 402 | Your account does not have enough credits for this generation. |
| `insufficient_balance` | 402 | Your API balance is too low for this generation. Top up in the console. |
| `key_limit_exceeded` | 402 | This API key has reached its spend limit for the current period. |
| `rate_limited` | 429 | Too many requests. Retry after the time in the Retry-After header. |
| `too_many_in_flight` | 429 | Too many generations are running at once on your account. Retry when one finishes. |
| `content_policy_violation` | 422 | The prompt or input was rejected by the content policy. |
| `provider_error` | 502 | The model provider failed. You were not charged. |
| `service_unavailable` | 503 | The service is temporarily unavailable. Retry with backoff. |
| `server_error` | 500 | Something went wrong on our side. Retry with backoff. |

## Rate limits

Each account can make 600 write requests and 1,200 read requests a minute. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a 429 also carries Retry-After. There is also a cap on generations running at once, returned as too_many_in_flight.

```http
HTTP/1.1 200 OK
X-RateLimit-Limit: 1200
X-RateLimit-Remaining: 1196
X-RateLimit-Reset: 1796046240

HTTP/1.1 429 Too Many Requests
Retry-After: 12
{"error": {"code": "rate_limited", "retryable": true, ...}}
```

X-RateLimit-Reset is the Unix time, in seconds, when the window refills. On a 429, wait Retry-After seconds and send the same request again with the same Idempotency-Key, so a retry can never run a job twice. The official SDKs retry 429 and 5xx responses this way on their own.

## Automatic model choice

Send "model": "auto" with a "route" object and Arteza picks the model: it reads the media you sent to work out the task (an image plus "video" is image-to-video, audio plus a face is an avatar), keeps only models that can do it with those fields, and ranks them by route.priority -- quality (default), speed or cost -- optionally under route.max_credits. The response carries a "routing" object naming the model, the reason and the runners-up. POST /v1/estimate with "model": "auto" is a free dry run.

```bash
curl https://arteza.ai/api/v1/generations \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "route": { "output": "video", "priority": "cost", "max_credits": 5 },
    "input": { "prompt": "A red fox runs through fresh snow at dawn", "image_url": "https://example.com/fox.jpg" }
  }'

# 202 ... "routing": {
#   "task": "image-to-video", "priority": "cost",
#   "chosen": { "model": "...", "credits": 1.7, "seconds": 90 },
#   "reason": "the lowest price for image-to-video with these inputs ...",
#   "alternatives": [ ... ], "dropped_fields": []
# }
```

## Apps

Every app on arteza.ai/apps runs on the API too. An app is one model behind a prompt we engineered and a library of presets: send "app" instead of "model", choose a preset, and add your photo or your words where the app takes them. The prompt is put together on our side exactly as on the app's page, and the run is billed, refunded and delivered like any other generation. GET /apps lists every app; GET /apps/{id} gives its preset ids and inputs.

```bash
curl https://arteza.ai/api/v1/generations \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app": "ai-room-converter",
    "input": { "preset": "library", "image_url": "https://example.com/my-room.jpg" }
  }'

# Presets and inputs for any app:
curl https://arteza.ai/api/v1/apps/ai-room-converter -H "Authorization: Bearer $ARTEZA_API_KEY"
```

## Studios

Fashion Studio and AI Influencer run on the API too, with the studio's own composition, model choice and second-chance re-render. A shoot photographs garments on a model: take a model, garments, shoes, a pose and a scene from GET /studios/fashion/catalog (presets, or your own added with POST /studios/fashion/items) and send up to 100 shots in one request. AI Influencer makes a persona with its portrait and identity sheet, then photographs it in any look, scene or product shot.

Every shot is one job, priced, charged and refunded on its own, and paid the way the key pays for any generation: plan credits at the studio price, or your USD balance at the provider's cost. Read jobs back with GET /studios/jobs, or receive studio_job.completed and studio_job.failed at your webhook.

```bash
# A catalog shoot: a model in a top and trousers, one job per shot
curl https://arteza.ai/api/v1/studios/fashion/shoots \
  -H "Authorization: Bearer $ARTEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "catalog",
    "shots": [{ "model": "MODEL_ID", "top": "GARMENT_ID", "bottom": "GARMENT_ID" }],
    "webhook_url": "https://example.com/hooks/arteza"
  }'

# Ids for models, garments, footwear, poses and scenes:
curl "https://arteza.ai/api/v1/studios/fashion/catalog?kind=models" -H "Authorization: Bearer $ARTEZA_API_KEY"

# An AI influencer (portrait and identity sheet), then a look:
curl https://arteza.ai/api/v1/studios/influencer/personas \
  -H "Authorization: Bearer $ARTEZA_API_KEY" -H "Content-Type: application/json" \
  -d '{ "name": "Mara", "prompt": "a travel photographer in her thirties" }'
curl https://arteza.ai/api/v1/studios/influencer/looks \
  -H "Authorization: Bearer $ARTEZA_API_KEY" -H "Content-Type: application/json" \
  -d '{ "persona": "PERSONA_ID", "scene": "a cafe terrace in Lisbon", "platform": "portrait" }'
```

## Image tools

Besides generation models, the API runs the studio's image tools: upscaling, background removal, inpainting, expanding, vectorizing to SVG, face swap, style transfer and photo edits. They are listed by GET /v1/models with "kind": "tool" and a "family", take an image_url, and are created, billed, refunded and delivered exactly like any other generation.

| Tool | id | Job |
| --- | --- | --- |
| Crystal Upscaler | `upscale-crystal` | upscale |
| Clarity Upscaler | `upscale-clarity` | upscale |
| Recraft Crisp Upscale | `upscale-recraft-crisp` | upscale |
| Recraft Creative Upscale | `upscale-recraft-creative` | upscale |
| Remove Background (BiRefNet) | `rmbg-birefnet` | remove-background |
| Remove Background (Bria) | `rmbg-bria` | remove-background |
| Inpaint (FLUX Fill) | `inpaint-flux-fill` | inpaint |
| Inpaint (Qwen) | `inpaint-qwen` | inpaint |
| Expand (Bria) | `outpaint-bria` | expand |
| Vectorize to SVG (Recraft) | `vectorize-recraft` | vectorize |
| Face Swap | `face-swap` | face-swap |
| Style Transfer | `style-transfer` | style-transfer |
| Relight | `relight` | photo-edit |
| Object Removal | `object-removal` | photo-edit |
| Photo Restoration | `restore` | photo-edit |
| Unblur | `unblur` | photo-edit |
| Colorize | `colorize` | photo-edit |
| Face Enhancer | `enhance` | photo-edit |
| Face Restore (CodeFormer) | `headshot` | photo-edit |
| Background Change | `bg-change` | photo-edit |

## Concurrency

Generations run in parallel. The table shows how many can be running at once for each account, per media kind. A request over the limit returns 429 too_many_in_flight with the current count and the cap, and costs nothing. Retry when a job finishes, or listen for its webhook.

| Plan | Video at once | Images at once |
| --- | ---: | ---: |
| FREE | 4 | 16 |
| STARTER | 8 | 24 |
| CREATOR | 12 | 32 |
| PRO | 20 | 48 |
| STUDIO | 32 | 64 |
| Pay as you go (USD balance) | 64 | 256 |

Plan credits from the API, MCP and the playground get four times the plan's studio limit.

The cap counts generations that are queued or running, not requests, so listing models, estimating and reading results never count against it. A job leaves the count the moment it completes, fails or is canceled. To run a large batch, keep a queue on your side and send the next request each time a generation.completed or generation.failed webhook arrives, or when the stream for a job ends. Requests per minute are limited separately, as described under rate limits. A higher plan raises the cap, as the table shows.

## Advanced options

Each model's input_schema lists its main controls, and many models also accept the provider's own settings, such as seed, negative_prompt, guidance_scale, num_inference_steps and output_format. These are marked "x-advanced": true. They change neither the price nor the content rules, and you can leave them out to use the model's defaults.

Every value is checked against the schema before anything is charged. A wrong type, a value outside an enum or a number out of range returns 400 invalid_parameter naming the field, and a field the model does not take returns 400 unknown_parameter.

To see exactly what a model takes, call GET /v1/models/{id}. Its input_schema is standard JSON Schema with the type, default, allowed values and range of every field, and its modes name the inputs each mode needs, such as an image for image to video. Send the same input to POST /v1/estimate first if you want to check it: it runs the same validation, so an input that estimates cleanly is accepted. A field that takes a file accepts an https URL, including the url returned by an upload. Defaults can change when a provider updates a model, so send any value your product depends on explicitly.

## Failures and refunds

You pay only for results. If the provider fails or refuses a request, the generation ends as failed and the full charge goes back to the balance it came from, credits or USD, automatically. You can cancel a queued generation with POST /v1/generations/{id}/cancel and get the same refund. The billing object of every generation shows whether it was refunded.

A failed generation carries error.code, error.retryable and error.message. Branch on the code: content_policy_violation (change the prompt or image), invalid_input (change the settings), timed_out and provider_error (safe to send again), insufficient_funds (top up). The message is English prose and may change.

Every generation that ends without a result is refunded, including one that stalls at the provider: a background check collects or settles any job that has run too long, so a charge is never left hanging. When error.retryable is true, send the request again with a new Idempotency-Key, because a key that was already used returns the original response instead of starting a new job. Webhooks report each outcome as generation.completed, generation.failed or generation.canceled, and the official SDKs raise a GenerationFailedError that carries the same code.

## Outputs and retention

Result files are stored on our CDN and their URLs stay valid until you delete the generation or your account, so you can link to them directly. Request logs are kept for 30 days.

```json
"output": {
  "files": [
    { "url": "https://assets.arteza.ai/generations/.../0.mp4", "type": "video" }
  ],
  "thumbnail_url": "https://assets.arteza.ai/generations/.../0.jpg"
}
```

Each file has its url and a type: image, video, audio, or file for anything else, such as a 3D model. DELETE /generations moves a generation to the trash: it leaves every listing at once and can be restored for 30 days. Download any file you need to keep before you delete it.

A generation's outputs array lists its files in the order the model returned them, so a request for four images returns four entries, and a completed generation always has at least one. The file format follows the model and any output_format you send. File URLs work without an API key, so anyone with a link can open that file: treat the URLs like shared links. To keep results in your own storage, copy each file to your bucket when the generation.completed webhook arrives, then delete the generation if you no longer need it here.

## Usage policy

The API and the MCP server follow the same rules as the Arteza studio. Every request passes the provider's content checks, and these cannot be switched off. Do not use the API to create sexual content involving minors, content that impersonates or sexualises a real person without consent, or anything illegal. Keys belong to one account: do not share or resell them. Repeated violations suspend the key and the account.

```json
{
  "id": "9a2d4e71-3c5b-4f08-b6e2-7d1c0a8f4b36",
  "object": "generation",
  "model": "seedance-2",
  "status": "failed",
  "created_at": "2026-11-28T10:04:00.000Z",
  "completed_at": "2026-11-28T10:04:03.118Z",
  "output": null,
  "error": {
    "code": "content_policy_violation",
    "retryable": false,
    "message": "The prompt or input was rejected by the content policy."
  },
  "billing": {
    "funding": "credits",
    "credits": 22.8,
    "refunded": true
  }
}
```

When a provider's content check refuses a prompt or an image, the generation fails with content_policy_violation and the full charge is refunded, so a refusal costs nothing. If you run the API behind your own app, check what your users submit as well, because repeated refusals on one key are reviewed. Bind client tokens to your end users with the user field: every generation is then tagged with that user, so a problem with one person can be traced and stopped without affecting the rest of your app.

Read the full rules: Terms of service: https://arteza.ai/terms -- Privacy policy: https://arteza.ai/privacy

## SDKs and tools

Official clients for TypeScript and Python, a command line for your terminal and scripts, and skills that teach coding agents to generate media correctly. Each one is small, has no dependencies, and is served straight from arteza.ai.

```bash
# TypeScript / JavaScript SDK and the `arteza` CLI
npm install https://arteza.ai/sdk/arteza.tgz
# Python SDK (python -m arteza for the CLI)
pip install https://arteza.ai/sdk/arteza-0.5.0-py3-none-any.whl
# Swift (iOS, macOS): one file, or the package zip for Xcode
curl -fsSL https://arteza.ai/sdk/swift/Arteza.swift -o Arteza.swift
# Kotlin (Android, JVM): one file, package ai.arteza
curl -fsSL https://arteza.ai/sdk/kotlin/Arteza.kt -o Arteza.kt
# Dart and Flutter: one file
curl -fsSL https://arteza.ai/sdk/dart/arteza.dart -o lib/arteza.dart
# Go
go get arteza.ai/sdk/go
# Skill for Claude Code
mkdir -p ~/.claude/skills/arteza && curl -fsSL https://arteza.ai/sdk/skills/arteza/SKILL.md -o ~/.claude/skills/arteza/SKILL.md
```

## MCP server

Arteza is also a remote MCP server, so AI assistants can use these models directly. It signs people in with OAuth and bills their plan credits at the studio price.

Server URL: https://arteza.ai/api/mcp

Add it to any assistant that supports remote MCP servers. The assistant opens a sign-in page the first time, then it can generate images, video and audio, edit images, run Fashion Studio and AI Influencer, estimate a price and check the balance.

The server uses the standard remote MCP transport over HTTPS with OAuth 2.1, PKCE and dynamic client registration, so an assistant such as Claude connects without an API key. Its tools list the models and apps, read their settings, estimate a cost, generate images, video and audio, edit an image, run an app, follow or cancel a job, upload a local file and list past generations. Every connection appears under Connected apps in the console with the assistant's name, and you can disconnect it there at any time: its access stops at once.

```bash
# Claude Code
claude mcp add --transport http arteza https://arteza.ai/api/mcp

# Clients that take a JSON config
{ "mcpServers": { "arteza": { "url": "https://arteza.ai/api/mcp" } } }
```

## Changelog

Every change to the API, the SDKs and the MCP server, newest first, with the SDK version that brought it.

### 2026-12-01

- SDKs for Swift (iOS and macOS), Kotlin (Android and the JVM), Dart and Flutter, and Go, each one file with no dependencies, served from arteza.ai. Go installs with go get arteza.ai/sdk/go. TypeScript and Python move to 0.5.0.
- GET /v1/events: every generation on the account live on one connection, resumable with since or Last-Event-ID, and events() in every SDK.
- MCP: list_apps, get_app and run_app run the studio's apps, and cancel_generation, influencer_sheet and create_upload bring the MCP server level with the API. list_models now marks which entries are image tools.
- Discovery: the whole documentation in one file at /llms-full.txt, an MCP server card at /.well-known/mcp.json, a questions section on the developer page, and the OpenAPI spec, docs.md and price list opened to search and answer engines.
- Docs: every model's request example now also comes in Go, Swift and Kotlin, and the mobile examples use client tokens.

### 2026-11-30

- Client tokens for browsers and mobile apps (POST /v1/tokens), usage reports by model, app or end user (GET /v1/usage), and live status as Server-Sent Events (GET /v1/generations/{id}/stream). SDK 0.4.0.
- Fashion Studio and AI Influencer on the API, the SDKs, the command line tool and the MCP server.
- A generation interrupted by a deploy is now collected from the provider and settled instead of failing, and every mode of every model can be reached from the API.
- The docs became one page per section, with a working example in each, in 31 languages.

### 2026-11-29

- Official TypeScript and Python SDKs, the arteza command line tool and a skill for Claude Code, installed straight from arteza.ai.
- API keys can carry an expiry date and a list of allowed IP addresses. SDK 0.1.1.
- The studio's apps on the API: GET /v1/apps lists them, and POST /v1/generations runs one by its id. SDK 0.2.0.
- The 20 image tools on the API and the MCP server, model "auto" routing, DELETE /v1/generations/{id}, a public price list with a CSV download, and usage export to CSV.

### 2026-11-28

- The v1 API: keys funded by plan credits or by a USD balance at the provider's own price, generations, uploads, signed webhooks, and a console for keys, usage, logs and the wallet.
- An OpenAPI 3.1 spec at /api/v1/openapi.json, generated from the live model catalogue.
- The remote MCP server at /api/mcp, with OAuth 2.1 sign-in and consent, for Claude and other assistants.
- Auto top-up for the USD balance, charged to the saved card.

## Questions developers ask

### How is the API priced?

Each key is funded by plan credits or by a USD balance. On a USD key you pay the provider's own price with no markup, plus the card processor's fee when you top up. On credits you pay the studio price on your plan. POST /v1/estimate returns the exact price of any request before you run it, for free.

### Do I pay for a generation that fails?

No. A generation that fails, is refused by a content check, stalls at the provider or is canceled is refunded in full to the balance it came from, automatically. The billing object of every generation shows whether it was refunded.

### Which models can I use?

Every model and image tool in the Arteza studio, for video, image, audio, avatars, editing and 3D, each with all of its modes, plus the studio's apps, Fashion Studio and AI Influencer. GET /v1/models lists them with their input schemas and prices.

### Can I call the API from a mobile app or a browser?

Yes, without exposing your key. Your server mints a short-lived client token with POST /v1/tokens, limited to the models you choose, a spend cap and one end user, and the app calls the API with that token. Every response carries CORS headers, so a web page can call the API directly.

### How do I get the result?

Generations run in the background. Poll GET /v1/generations/{id}, follow it live as Server-Sent Events at /v1/generations/{id}/stream, or pass webhook_url and receive a signed webhook when it completes or fails. The SDKs wait for the result in one call.

### What are the rate limits?

Each account can make 600 write and 1,200 read requests a minute, and run a number of generations at once that depends on its plan. Every response carries the X-RateLimit headers, and a 429 says how long to wait before retrying.

### Which programming languages are supported?

There are official SDKs for TypeScript, Python, Swift, Kotlin, Dart and Flutter, and Go, a command line tool, and a skill for Claude Code. Each SDK retries safely, waits for results, follows jobs live and handles uploads and client tokens. Any other language works over plain HTTPS, and the OpenAPI spec can generate a client for it.

### Can AI assistants and agents use it?

Yes. Arteza is a remote MCP server: Claude and other assistants connect with a sign-in instead of a key, then generate, edit, run apps and studios and check prices. The full docs are also published as one Markdown file and in llms-full.txt for any agent to read.

### How long are results kept?

Result files stay on our CDN until you delete the generation or your account, so you can link to them directly. A deleted generation can be restored from the trash for 30 days, and request logs are kept for 30 days.
