---
description: Generate images, video, audio, voice, avatars, 3D and image edits (upscale, remove background, inpaint, expand, vectorize, face swap, relight, restore) with the Arteza API -- 100+ models behind one key. Use when the user asks to create or edit media, pick a generation model, price a generation, or wire Arteza into code.
alwaysApply: false
---

# Arteza

Arteza runs 100+ image, video and audio models and 20 image tools behind one REST API at `https://arteza.ai/api/v1`, billed at the provider's cost (pay-as-you-go keys) or in plan credits.

## Before you start

- The key is in `ARTEZA_API_KEY`. If it is missing, ask the user to create one at https://arteza.ai/developers/console -- never invent one and never print it.
- Prefer the CLI for one-off work and the SDK inside code:
  - CLI / Node SDK: `npm install -g https://arteza.ai/sdk/arteza.tgz` then `arteza ...`
  - Python SDK: `pip install https://arteza.ai/sdk/arteza-0.2.0-py3-none-any.whl` then `python -m arteza ...`
  - No install: plain HTTPS with `Authorization: Bearer $ARTEZA_API_KEY`.
- If Arteza's MCP server is connected (`https://arteza.ai/api/mcp`), its tools do all of this directly; use them.

## Choosing a model

1. Do not guess ids. List them: `arteza models --category video --json` (categories: image, video, audio, avatar, 3d, edit) or `GET /models`.
2. Read a model's exact inputs before calling it: `arteza model <id> --json` or `GET /models/{id}`, or the agent-ready page `https://arteza.ai/api/v1/models/<id>/llms.txt`.
3. Unsure which model? Use `model: "auto"` with `route.task` (text-to-image, image-edit, text-to-video, image-to-video, video-edit, avatar, speech, music, sound-effects, transcribe, 3d) and optional `route.priority` (quality, speed, cost). The response's `routing` says which model ran and why.

## Apps

For a finished look rather than a raw model (turn a room into a library, a product into an ad, a selfie into a headshot), use an app: `arteza apps --json`, then `arteza app <id> --json` for its preset ids, then `arteza run --app <id> preset=<id> image_url=@./photo.jpg`. Over HTTP send `"app"` instead of `"model"` to `POST /generations`. Apps are one model with an engineered prompt; the prompt is composed server-side, so never try to reproduce it.

## Studios

Fashion Studio photographs garments on models; AI Influencer designs a consistent persona and photographs it in looks. They run as studio jobs, not generations:

- Fashion: list ids with `arteza catalog fashion <models|garments|footwear|accessories|poses|scenes> --json` (or `GET /studios/fashion/catalog?kind=...`). Add the user's own photos as items (`POST /studios/fashion/items` with a `/uploads` url). Shoot with `arteza shoot catalog model=<id> top=<id> bottom=<id> --tier draft` or `POST /studios/fashion/shoots` with `shots: [...]`; every shot is its own job. Use `tier: "draft"` while iterating.
- Influencer: `arteza persona -p "<description>"` makes the persona and its identity sheet (two jobs); `arteza look <persona-id> scene="..." platform=portrait` photographs it. Persona ids: `arteza catalog influencer personas --json`.
- Price first with `POST /studios/fashion/estimate` or `/studios/influencer/estimate`. Poll `GET /studios/jobs/{id}` (or `arteza jobs --batch <id>`); a failed job is refunded in full.

## Cost discipline

- Generations spend the user's money. For anything expensive (video, long audio, many outputs) or when the user did not ask for a specific spend, price it first: `arteza estimate <model> ...` or `POST /estimate`, and tell the user the price.
- Never loop retries on a failed generation without telling the user; failures are refunded in full, but repeated attempts each charge.
- Unknown input fields are refused with `400 unknown_parameter` and out-of-range values with `400 invalid_parameter`, before anything is charged. Fix the input from `error.param` and `error.message`.

## Running

CLI:

```bash
arteza run seedance-2 -p "a koi pond at dawn, slow dolly in" duration=5 -o ./out --json
arteza run rmbg-birefnet image_url=@./photo.png -o ./out     # @file uploads a local file first
arteza run auto -p "a logo for a coffee shop" --task text-to-image --priority cost
```

TypeScript:

```ts
import { Arteza } from "arteza";
const arteza = new Arteza();
const gen = await arteza.run("seedance-2", { prompt: "...", duration: 5 });
gen.output?.files.forEach((f) => console.log(f.type, f.url));
```

Python:

```python
from arteza import Arteza
gen = Arteza().run("seedance-2", {"prompt": "...", "duration": 5})
```

HTTP: `POST /generations` with `{"model": "...", "input": {...}}` and an `Idempotency-Key` header returns `202` with an `id`; poll `GET /generations/{id}` until `status` is `completed`, `failed` or `canceled`, or pass `webhook_url`. Local files go through `POST /uploads` (returns a signed `upload_url` to PUT to and the `url` to pass as input).

## Results

A completed generation has `output.files[]` with `url` and `type` (image, video, audio, file) and `billing` (credits or usd, `refunded`). Download the files the user asked for into the project, and report the cost.

## Errors worth knowing

| code | meaning | do |
| --- | --- | --- |
| insufficient_credits / insufficient_balance | the account cannot pay | tell the user; top up at https://arteza.ai/developers/console |
| too_many_in_flight / rate_limited | concurrency or rate cap | wait `Retry-After` seconds, retry (the SDKs do this) |
| content_policy_violation | the provider refused the prompt or media | rephrase; do not retry unchanged |
| model_unavailable | temporarily off | pick another model of the same task |

Full reference: https://arteza.ai/api/v1/docs.md -- OpenAPI: https://arteza.ai/api/v1/openapi.json -- prices: https://arteza.ai/api/v1/prices.csv
