Skip to content

Video, image and avatar generation over one REST API

Every endpoint below has a copyable curl example, its fields, a sample answer and the errors it returns. Building with a coding agent? Copy the whole reference into it in one click.

Open as Markdown
Base URL
https://avatarity.dev
Auth header
Authorization: Bearer $AVATARITY_API_KEY
Same text for agents
/llms.txt/docs/agent.mdOpenAPI

16 endpoints in 7 sections.

Getting started

Base URL, your API key, what each call counts against, and the rules for retries and limits.

Base URL and API key

Every endpoint lives under https://avatarity.dev/v1/. Requests and answers are JSON over HTTPS.

Create a key in the Studio at https://avatarity.dev/studio/api-keys. It starts with av_live_ and is shown once. Keep it on your server (for example in AVATARITY_API_KEY), never in browser code.

Send it on every call as Authorization: Bearer $AVATARITY_API_KEY.

Check your key
curl -sS https://avatarity.dev/v1/usage \
  -H "Authorization: Bearer $AVATARITY_API_KEY"

Your first video

Start a render, poll the task until status is succeeded, then download video_url. The script below does all three with curl and jq.

first-video.sh
# 1. Your key from https://avatarity.dev/studio/api-keys
export AVATARITY_API_KEY="av_live_..."

# 2. Start a render. The answer is 202 with a task_id.
TASK_ID=$(curl -sS -X POST https://avatarity.dev/v1/video/generations \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "veo-3.1-lite",
  "prompt": "A slow dolly shot across a quiet harbour at sunrise, fishing boats rocking gently, mist on the water.",
  "aspect_ratio": "16:9"
}' | jq -r '.task_id')
echo "task: $TASK_ID"

# 3. Poll every 10 s until the task succeeds or fails.
while true; do
  TASK=$(curl -sS https://avatarity.dev/v1/tasks/$TASK_ID \
    -H "Authorization: Bearer $AVATARITY_API_KEY")
  STATUS=$(echo "$TASK" | jq -r '.status')
  echo "status: $STATUS ($(echo "$TASK" | jq -r '.progress_pct')%)"
  case "$STATUS" in
    succeeded) break ;;
    failed|cancelled) echo "$TASK" | jq '.error'; exit 1 ;;
  esac
  sleep 10
done

# 4. Download the MP4 (video_url is a pre-signed link; it expires, so fetch it soon).
curl -sS -L -o first-video.mp4 "$(echo "$TASK" | jq -r '.video_url')"
echo "saved first-video.mp4"

What each call counts

Video and image calls count against your monthly plan. One 720p video counts as 1 video, one 1080p video counts as 2 videos (720p plus an upscale pass), and upscaling a finished video to 1080p counts as 1 video. Every image counts as 1 image, so n: 4 counts 4.

A render that fails or is cancelled is never counted. Allowances reset each paid month and do not roll over. GET /v1/usage shows what is left.

Avatar videos are paid from avatar credits, not from the plan: Avatar 3 costs $0.25 per minute of finished video, billed by the second.

PlanPriceVideos / monthImages / monthRenders at once
Free$0Free rendersFree renders1
Starter$30 / month2,0005,0004
Pro$70 / month8,00020,0004
Advanced$250 / month25,00050,0008
Dedicated$400 / monthNo fixed capNo fixed cap16

Rate limits and parallel renders

Each key has a limit of requests per minute. Answers carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets). Over the limit you get 429 RATE_LIMIT_EXCEEDED: wait until the reset, then retry with backoff.

Your plan also sets how many renders run at once (table above). Over that you get 429 CONCURRENCY_LIMIT: wait for a task to finish and retry.

Video and image answers carry X-Avatarity-Remaining-Veo and X-Avatarity-Remaining-Images: what is left this month.

Safe retries (Idempotency-Key)

Send Idempotency-Key: <uuid> on every POST that starts a render. Retrying with the same key within 24 hours returns the first answer (header X-Cache: Idempotent-Hit) and never starts or counts a second render.

While the first request is still being accepted, the same key answers 409 IDEMPOTENT_OPERATION_IN_FLIGHT: wait a second and retry with the same key. Use a new key for a new render.

List models

GET/v1/modelsNo key needed

List the models on sale right now, with their options; no key needed.

Example request
curl -sS https://avatarity.dev/v1/models
Response · 200
{
  "object": "list",
  "data": [
    {
      "id": "veo-3.1-lite",
      "object": "model",
      "type": "video",
      "product": "veo",
      "supported_parameters": [
        "prompt",
        "aspect_ratio",
        "duration",
        "resolution",
        "image",
        "seed",
        "webhook_url"
      ]
    },
    {
      "id": "nano-banana-pro",
      "object": "model",
      "type": "image",
      "product": "images"
    }
  ]
}

Shortened. Each model also lists its aspect ratios, resolutions and billing.

Video

Veo 3.1 Lite video with sound from a text prompt, a start frame, start and end frames, or reference images. Renders run in the background: you get a task id at once.

What you can send

Text only: prompt. Animate a picture: add image (the first frame). Go from one picture to another: add image and end_frame. Keep a person, product or style the same: add up to 3 reference_images with reference_images_consent: true (not together with frames).

Images can be public https:// URLs or data:image/...;base64, URIs (PNG, JPEG or WebP, up to 15 MB).

Every clip is 4, 6 or 8 seconds (default 8), 16:9 or 9:16, at 720p (1 video) or 1080p (2 videos). Each length counts the same.

Omni clips (longer, paid per clip)

Send model: "omni-1.2-flash" for a 720p clip with sound from a text prompt, 16:9 or 9:16. It is paid from your Omni credits (prepaid in the Studio under Billing), not from the plan, and only when the clip is delivered.

duration is 8 or 10 to 15 seconds (default 8). A length between two sold lengths is rounded to the nearer one; a length outside the range is refused with VALIDATION_FAILED. The duration_seconds in the response says which length you get.

The price depends on the length: GET /v1/models lists durations_seconds and billing.prices_by_duration (cents per clip) for omni-1.2-flash. A dry_run request answers price_cents for exactly that clip without starting it.

Create a video

POST/v1/video/generations

Start a video render and get its task id back right away.

Example request
curl -sS -X POST https://avatarity.dev/v1/video/generations \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "veo-3.1-lite",
    "prompt": "A slow dolly shot across a quiet harbour at sunrise, fishing boats rocking gently, mist on the water.",
    "aspect_ratio": "16:9",
    "duration": 8,
    "resolution": "720p"
  }'

Request body

promptstringrequired
What happens in the clip: scene, camera, light, sound, dialogue. 3 to 10,000 characters, sent as written.
modelstring
veo-3.1-lite (default), or omni-1.2-flash (Omni clips, text only, paid from Omni credits).
durationinteger
4, 6 or 8 seconds (default 8). Omni: 8 or 10 to 15; the price follows the length (GET /v1/models prices_by_duration). Alias duration_seconds.
aspect_ratiostring
16:9 (default) or 9:16.
resolutionstring
720p (default, counts 1 video) or 1080p (counts 2 videos).
imagestring
First frame: https:// URL or data:image URI. Alias start_frame.
end_framestring
Last frame, same format. Use together with image.
reference_imagesstring[]
Up to 3 https:// image URLs that keep a person, product or style consistent. Not together with image or end_frame.
reference_images_consentboolean
Must be true with reference_images: you own the images or have permission from everyone shown.
seedinteger
Same seed and prompt give a similar result.
webhook_urlstring
Public https:// URL we POST to when the task starts, succeeds or fails. See Tasks & webhooks.
dry_runboolean
true: check the request only. Answers 200 with status: "validated" (Omni: plus price_cents for that clip); nothing starts and nothing is counted.
Response · 202
{
  "id": "task_mhx2k9q1_4f7a9c2e81b3",
  "task_id": "task_mhx2k9q1_4f7a9c2e81b3",
  "status": "queued",
  "model": "veo-3.1-lite",
  "duration_seconds": 8,
  "eta_seconds": 90,
  "created_at": "2026-11-23T09:30:00.000Z",
  "links": {
    "query": "/v1/video/query?task_id=task_mhx2k9q1_4f7a9c2e81b3"
  }
}

Shortened. Then poll GET /v1/tasks/{id} or wait for your webhook.

Common errors

  • 400INVALID_PAYLOADThe JSON body failed the schema check. error.details names each field and what is wrong with it.
  • 400VALIDATION_FAILEDA field has a value this model does not accept, for example a video aspect ratio other than 16:9 or 9:16, or an image URL that is not public HTTPS.
  • 400CONTENT_POLICY_VIOLATIONThe prompt or an input image was refused by the content check. Image calls answer 422 when the model refuses after starting. Nothing is counted.
  • 402ALLOWANCE_EXHAUSTEDThis month’s videos or images are used up.
  • 429CONCURRENCY_LIMITThe API already runs as many renders as your plan allows at once.
  • 429RATE_LIMIT_EXCEEDEDThis key sent more requests per minute than it may.

Upscale a video to 1080p

POST/v1/video/generations

Turn one of your finished 720p videos into 1080p; counts as 1 video.

Example request
curl -sS -X POST https://avatarity.dev/v1/video/generations \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "veo-3.1-lite",
    "source_task_id": "task_mhx2k9q1_4f7a9c2e81b3",
    "prompt": "upscale"
  }'

Request body

source_task_idstringrequired
The task id of one of your finished veo-3.1-lite videos.
promptstringrequired
Required by the schema but not used for an upscale; any text of 3 or more characters.
modelstring
veo-3.1-lite (default).
webhook_urlstring
Public https:// URL we POST to when the task starts, succeeds or fails. See Tasks & webhooks.
Response · 202
{
  "task_id": "task_mhx3a1b2_9d0e1f2a3b4c",
  "status": "queued",
  "model": "veo-3.1-lite",
  "created_at": "2026-11-23T09:40:00.000Z"
}

Shortened. The new task delivers the 1080p file.

reference_images and resolution: "720p" cannot be combined with source_task_id.

Common errors

  • 400VALIDATION_FAILEDA field has a value this model does not accept, for example a video aspect ratio other than 16:9 or 9:16, or an image URL that is not public HTTPS.
  • 402ALLOWANCE_EXHAUSTEDThis month’s videos or images are used up.
  • 429CONCURRENCY_LIMITThe API already runs as many renders as your plan allows at once.

Images

Nano Banana images from a prompt, optionally guided by reference images. By default the answer waits and returns the image links.

Models

Each image counts as 1 image from your plan, whatever the model.

ModelGood forReference images
nano-banana-2 (default)Fast drafts, thumbnails, variantsUp to 4
nano-banana-2.1Consistent characters and storyboardsUp to 10
nano-banana-proPhotoreal shots and legible text in the imageUp to 10

Create images

POST/v1/images/generations

Make 1 to 4 images from a prompt and get their links in the same answer.

Example request
curl -sS -X POST https://avatarity.dev/v1/images/generations \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "Product photo of a matte black water bottle on wet slate, soft morning light, shallow depth of field.",
    "aspect_ratio": "1:1",
    "n": 2
  }'

Request body

promptstringrequired
What the image shows. 3 to 10,000 characters.
modelstring
nano-banana-2 (default), nano-banana-2.1 or nano-banana-pro.
ninteger
How many images, 1 to 4 (default 1). Each counts as 1 image.
aspect_ratiostring
16:9 (default), 9:16, 1:1, 4:3 or 3:4.
sizestring
Instead of aspect_ratio: 1376x768, 768x1376, 1024x1024, 1184x864 or 864x1184.
reference_imagesstring[]
Images to follow: https:// URLs or data:image URIs. Up to 4, or 10 on nano-banana-2.1 and nano-banana-pro.
seedinteger
Same seed and prompt give a similar result.
asyncboolean
true: answer 202 with a task_id at once instead of waiting; poll GET /v1/tasks/{id} for image_urls.
Response · 200
{
  "created": 1795431000,
  "data": [
    {
      "url": "https://avatarity.dev/v1/storage/object?token=example-signed-token-1"
    },
    {
      "url": "https://avatarity.dev/v1/storage/object?token=example-signed-token-2"
    }
  ]
}

The links are pre-signed and expire: download the files soon.

503 CAPACITY_BUSY only happens on the waiting call. Retry after Retry-After, or send async: true and the job waits in the queue by itself.

Common errors

  • 400INVALID_PAYLOADThe JSON body failed the schema check. error.details names each field and what is wrong with it.
  • 400VALIDATION_FAILEDA field has a value this model does not accept, for example a video aspect ratio other than 16:9 or 9:16, or an image URL that is not public HTTPS.
  • 400CONTENT_POLICY_VIOLATIONThe prompt or an input image was refused by the content check. Image calls answer 422 when the model refuses after starting. Nothing is counted.
  • 503CAPACITY_BUSYSynchronous image calls (POST /v1/images/generations without async) only: the image could not start within the request, so nothing ran and nothing was counted. The response carries Retry-After and retry_after_seconds. Asynchronous jobs never get this answer: they wait in the queue instead.
  • 402ALLOWANCE_EXHAUSTEDThis month’s videos or images are used up.
  • 429RATE_LIMIT_EXCEEDEDThis key sent more requests per minute than it may.

Avatars

Talking-presenter videos: pick an avatar and a voice, send a script or an audio file, and get an MP4.

Price and balance

Avatar 3 (avatar-3) costs $0.25 per minute of finished video, billed by the second. It is paid from avatar credits, which you buy as packs in the Studio under Billing; the plan's video allowance is not used.

The price of the requested length is held when the render starts. A shorter video gives the rest back, and a failed render gives everything back.

PackAvatar 3 minutes
$30120 min
$75300 min
$150600 min
$3001,200 min

How a render works

1. GET /v1/avatar/catalog to pick an avatar_id and a voice_id. 2. POST /v1/avatar/generate with your script. 3. Renders of up to 20 seconds answer 200 with video_url when done; longer ones answer 202 with a task_id. 4. Poll GET /v1/avatar/tasks/{id} every 15 seconds until status is completed or failed.

Avatar tasks use completed where video and image tasks use succeeded.

List avatars and voices

GET/v1/avatar/catalog

List the avatars (with their looks) and the voices you can use right now.

Example request
curl -sS https://avatarity.dev/v1/avatar/catalog \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "avatars": [
    {
      "id": "studio_avatar_anna",
      "name": "Anna",
      "gender": "female",
      "type": "preconfigured",
      "looks": [
        "office",
        "casual"
      ],
      "default_look": "office",
      "preview_image_url": "https://avatarity.dev/v1/storage/object?token=example-preview"
    }
  ],
  "voices": [
    {
      "id": "studio_voice_en_f1",
      "name": "Clara",
      "gender": "female",
      "language": "en-US"
    }
  ]
}

Shortened. Your own photo avatars are listed too.

Common errors

Create an avatar video

POST/v1/avatar/generate

Render a talking-avatar video from a script (or an audio file).

Example request
curl -sS -X POST https://avatarity.dev/v1/avatar/generate \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "avatar-3",
    "avatar_id": "studio_avatar_anna",
    "voice_id": "studio_voice_en_f1",
    "script": "Welcome to the product tour. In the next minute I will show you the three things that matter.",
    "aspect_ratio": "16:9",
    "duration_seconds": 30
  }'

Request body

modelstringrequired
avatar-3.
avatar_idstringrequired
From GET /v1/avatar/catalog, or the id of your own photo avatar. Or send image_url instead.
scriptstringrequired
What the avatar says (up to 10,000 characters). Or send audio_url instead.
voice_idstring
A voice from the catalog. Leave it out to use the avatar’s own voice.
audio_urlstring
Public https:// speech audio to lip-sync, instead of script.
image_urlstring
Public https:// portrait to animate, instead of avatar_id.
aspect_ratiostring
16:9 (default), 9:16 or 1:1.
duration_secondsnumber
Expected length, 2 to 600 (default 10). Sets the hold; the charge follows the real length.
Response · 202
{
  "task_id": "avatar_mhx4c5d6_1a2b3c4d",
  "status": "processing",
  "model": "avatar-3",
  "duration_seconds": 30,
  "links": {
    "query": "/v1/avatar/query?task_id=avatar_mhx4c5d6_1a2b3c4d"
  }
}

Up to 20 seconds the call waits and answers 200 with status "completed" and video_url.

avatar-4 is not on sale yet and answers 400 AVATAR_MODEL_COMING_SOON.

Common errors

Get an avatar task

GET/v1/avatar/tasks/{id}

Check an avatar render and get its video link when it is done.

Example request
curl -sS https://avatarity.dev/v1/avatar/tasks/avatar_mhx4c5d6_1a2b3c4d \
  -H "Authorization: Bearer $AVATARITY_API_KEY"

In the path

idstringrequired
The task_id from POST /v1/avatar/generate.
Response · 200
{
  "task_id": "avatar_mhx4c5d6_1a2b3c4d",
  "status": "completed",
  "duration_seconds": 29,
  "progress_percent": 100,
  "video_url": "https://avatarity.dev/v1/storage/object?token=example-signed-token",
  "error": null,
  "created_at": "2026-11-23T09:30:00.000Z",
  "updated_at": "2026-11-23T09:34:10.000Z"
}

`status` is `processing`, `completed` or `failed`.

Common errors

  • 404NOT_FOUNDThe task, render or resource does not exist on this account.

List your photo avatars

GET/v1/avatar/custom

List the avatars you made from your own photos, with their looks.

Example request
curl -sS https://avatarity.dev/v1/avatar/custom \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "status": "success",
  "count": 1,
  "custom_avatars": [
    {
      "id": "av_usr_3f9a1c2b7d4e",
      "name": "Founder",
      "type": "custom",
      "looks": [
        "default"
      ],
      "default_look": "default",
      "provisioning_status": "ready",
      "created_at": "2026-11-23T09:00:00.000Z"
    }
  ]
}

Shortened.

Common errors

Create a photo avatar

POST/v1/avatar/custom

Turn a portrait photo into an avatar (a new look) you can render with.

Example request
curl -sS -X POST https://avatarity.dev/v1/avatar/custom \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Founder",
    "photo_url": "https://example.com/portraits/founder.jpg",
    "gender": "female"
  }'

Request body

namestringrequired
A name for the avatar.
photo_urlstringrequired
Public https:// portrait, face clearly visible. Or send photo_base64 instead.
genderstring
male, female or neutral (default).
default_voicestring
Voice used when a render sends no voice_id.
Response · 201
{
  "status": "success",
  "avatar": {
    "id": "av_usr_3f9a1c2b7d4e",
    "name": "Founder",
    "type": "custom",
    "looks": [
      "default"
    ],
    "default_look": "default",
    "provisioning_status": "ready"
  },
  "provisioning": {
    "avatar_id": "av_usr_3f9a1c2b7d4e",
    "deduplicated": false,
    "default_look_id": "default"
  }
}

Shortened. Use avatar.id as avatar_id. The same photo twice returns the same avatar.

Only use photos of yourself or of people who agreed. The photo passes the content check first.

Common errors

Tasks & webhooks

Every video render, and every image request sent with async: true, becomes a task. Poll it, or let us call your webhook.

Task status

queued → processing → succeeded, or failed / cancelled. Only succeeded, failed and cancelled are final.

Poll every 10 seconds. While queued, the task also shows queue_position and est_start_seconds. A failed task carries error.code and error.message and is not counted.

video_url and image_urls are pre-signed links that expire: download the files soon after succeeded.

Webhooks

Add webhook_url to a video request and we POST to it on task.started, task.succeeded and task.failed. Answer with any 2xx within 5 seconds; a failed delivery is retried up to 3 times. Keep polling as a fallback.

Each delivery is signed (Standard Webhooks): headers webhook-id, webhook-timestamp and webhook-signature (v1,<base64 HMAC-SHA256 of "id.timestamp.body">). Get your signing secret once with POST /v1/webhooks/secret/rotate and verify every delivery.

Example delivery body
{
  "id": "evt_5b1f0c9e2a7d4e8f6a3b2c1d",
  "event": "task.succeeded",
  "taskId": "task_mhx2k9q1_4f7a9c2e81b3",
  "timestamp": "2026-11-23T09:31:42.000Z",
  "data": {
    "status": "succeeded",
    "video_url": "https://avatarity.dev/v1/storage/object?token=example-signed-token",
    "duration_seconds": 8
  }
}

Verify a webhook (Node.js)

Reject any delivery whose signature does not match or whose timestamp is older than 5 minutes.

verify-webhook.ts
import crypto from 'node:crypto';

// rawBody: the request body exactly as received (before JSON.parse).
export function verifyAvatarityWebhook(rawBody: string, headers: Record<string, string | undefined>): boolean {
  const secret = process.env.AVATARITY_WEBHOOK_SECRET!; // whsec_... from POST /v1/webhooks/secret/rotate
  const id = headers['webhook-id'];
  const timestamp = headers['webhook-timestamp'];
  const signatures = headers['webhook-signature'];
  if (!id || !timestamp || !signatures) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // older than 5 minutes

  const key = secret.startsWith('whsec_') ? Buffer.from(secret.slice(6), 'base64') : Buffer.from(secret, 'utf8');
  const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest('base64');
  return signatures.split(' ').some((entry) => {
    const sig = entry.split(',')[1] ?? '';
    return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  });
}

Get a task

GET/v1/tasks/{id}

Check a video or image task and get its result links when it is done.

Example request
curl -sS https://avatarity.dev/v1/tasks/task_mhx2k9q1_4f7a9c2e81b3 \
  -H "Authorization: Bearer $AVATARITY_API_KEY"

In the path

idstringrequired
The task_id from the create call.
Response · 200
{
  "task_id": "task_mhx2k9q1_4f7a9c2e81b3",
  "status": "succeeded",
  "model": "veo-3.1-lite",
  "progress_pct": 100,
  "video_url": "https://avatarity.dev/v1/storage/object?token=example-signed-token",
  "thumbnail_url": null,
  "created_at": "2026-11-12T09:30:00.000Z",
  "completed_at": "2026-11-12T09:31:42.000Z",
  "error": null
}

Image tasks carry image_urls instead of video_url.

Common errors

  • 404TASK_NOT_FOUNDGET /v1/tasks/{id} found no task with this id on your account.
  • 200CAPACITY_TIMEOUTTask error (GET /v1/tasks/{id}, webhooks): the job waited in the queue for 5.5 hours without starting. Jobs never fail just because the queue is busy; they wait, and only this upper bound ends the wait. Nothing was charged.

Show the webhook secret

GET/v1/webhooks/secret

See which webhook signing secret is active (masked).

Example request
curl -sS https://avatarity.dev/v1/webhooks/secret \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "object": "webhook_secret",
  "masked_secret": "whsec_****Qk9z",
  "created_at": "2026-11-01T10:00:00.000Z",
  "signature_scheme": "standard-webhooks-v1"
}

Shortened.

Common errors

Rotate the webhook secret

POST/v1/webhooks/secret/rotate

Create a new webhook signing secret; it is shown once.

Example request
curl -sS -X POST https://avatarity.dev/v1/webhooks/secret/rotate \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "object": "webhook_secret",
  "secret": "whsec_<new secret, shown once>",
  "masked_secret": "whsec_****bHk=",
  "created_at": "2026-11-23T09:00:00.000Z",
  "signature_scheme": "standard-webhooks-v1"
}

Store secret now. Deliveries are signed with the new secret from here on.

Common errors

Account

Your plan, what is left this month, and your API keys.

Get usage

GET/v1/usage

See your plan, what is left this month and how many renders run right now.

Example request
curl -sS https://avatarity.dev/v1/usage \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "plan": {
    "id": "pro",
    "name": "Pro",
    "price_cents": 7000,
    "currency": "USD",
    "concurrency": 4
  },
  "status": "active",
  "current_period_end": "2026-12-23T09:00:00.000Z",
  "allowances": {
    "veo": {
      "granted": 8000,
      "used": 120,
      "reserved": 2,
      "remaining": 7878
    },
    "images": {
      "granted": 20000,
      "used": 340,
      "reserved": 0,
      "remaining": 19660
    }
  },
  "concurrency": {
    "limit": 4,
    "in_flight": 1,
    "available": 3
  },
  "video_units": {
    "p720": 1,
    "p1080": 2,
    "upscale": 1
  }
}

Shortened. remaining is null on plans without a fixed cap.

Common errors

List API keys

GET/v1/tokens

List the API keys on your account (never the full key).

Example request
curl -sS https://avatarity.dev/v1/tokens \
  -H "Authorization: Bearer $AVATARITY_API_KEY"
Response · 200
{
  "object": "list",
  "data": [
    {
      "id": "av_live_9f81b2c4d5e6",
      "name": "Production",
      "scopes": [
        "*"
      ],
      "created_at": "2026-11-01T10:00:00.000Z",
      "last_used_at": "2026-11-23T09:30:00.000Z"
    }
  ],
  "total": 1
}

Shortened.

Common errors

Rotate an API key

POST/v1/tokens/{id}/rotate

Get a new secret for a key while the old one keeps working for a grace period.

Example request
curl -sS -X POST https://avatarity.dev/v1/tokens/av_live_9f81b2c4d5e6/rotate \
  -H "Authorization: Bearer $AVATARITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "grace_period_ms": 86400000
  }'

Request body

idstring (path)required
The key id from GET /v1/tokens.
grace_period_msinteger
How long the old secret keeps working, in milliseconds (default 86400000, 24 hours).
Response · 200
{
  "object": "token_rotation",
  "id": "av_live_9f81b2c4d5e6",
  "raw_key": "av_live_9f81b2c4d5e6_<new secret, shown once>",
  "grace_expires_at": "2026-11-24T09:30:00.000Z"
}

Store raw_key now; it is not shown again.

Common errors

Revoke an API key

DELETE/v1/tokens/{id}

Switch a key off for good.

Example request
curl -sS -X DELETE https://avatarity.dev/v1/tokens/av_live_9f81b2c4d5e6 \
  -H "Authorization: Bearer $AVATARITY_API_KEY"

In the path

idstringrequired
The key id from GET /v1/tokens.
Response · 200
{
  "success": true,
  "revoked_id": "av_live_9f81b2c4d5e6"
}

Shortened. Requests with this key fail from now on.

Common errors

Errors

Every error has the same shape, a stable code and a next step.

Error format

Errors answer with a 4xx or 5xx status and {"error": {"code", "message", "doc_url"}}. Branch on error.code, show error.message to people. Schema errors add error.details with one entry per field.

Retry only 429 and 503 answers (after Retry-After or X-RateLimit-Reset), and always with the same Idempotency-Key. Fix the request for every other 4xx.

Example
{
  "error": {
    "code": "ALLOWANCE_EXHAUSTED",
    "message": "This month’s videos are used up.",
    "doc_url": "https://avatarity.dev/docs/errors#ALLOWANCE_EXHAUSTED"
  }
}

Safety warnings

When many of your renders are refused by the content check, render and task answers carry warnings: [{ "code": "SAFETY_REFUSALS_HIGH", ... }] and an X-Avatarity-Warning header, and new renders may be slowed with 429 SAFETY_REFUSAL_COOLDOWN until cooldown_until. Show the message and change the prompts or images; do not resend the same content.

All error codes

Open the error page
401AUTHENTICATION_REQUIRED

The request has no Authorization header, or it is not in the form Bearer <key>.

Send your key as Authorization: Bearer av_live_... on every /v1 call. Create one in the Studio under API keys.

401INVALID_TOKEN

The API key is not valid (typo, wrong account, or deleted).

Copy the key again from the Studio under API keys, or create a new one.

401UNAUTHENTICATED

The Studio session or API key is missing, invalid or expired.

Sign in again at /login, or send your key as Authorization: Bearer av_live_...

401TOKEN_REVOKED

The API key was revoked or rotated and its grace period has ended.

Create a new key in the Studio under API keys and update your integration.

403INSUFFICIENT_SCOPE

The API key is not allowed to call this endpoint.

Use a key created in the Studio; it covers video, image and avatar calls.

403IP_NOT_PERMITTED

The request came from an address outside the key’s IP allowlist.

Call from an allowed address, or change the allowlist in the Studio under API keys.

403TENANT_SUSPENDED

The account is suspended, so new renders and new API keys are blocked.

Contact support from the Studio Help page.

403ACCOUNT_PENDING_ACTIVATION

The account is not activated yet, so it cannot render.

Finish the activation steps you were sent by email, or contact support.

402SUBSCRIPTION_REQUIRED

There is no active plan on this account.

Choose a plan at /pricing or in the Studio under Plan & billing.

402ALLOWANCE_NOT_ACTIVE

The plan exists but this month’s allowance is not active yet.

It appears as soon as the payment is confirmed, usually within a minute.

402ALLOWANCE_EXHAUSTED

This month’s videos or images are used up.

Upgrade the plan in Plan & billing, or wait for the next paid month. GET /v1/usage shows what is left.

402FREE_LIMIT_REACHED

The free account has used what it may render for now.

Wait for the limit to reset, or choose a plan at /pricing.

402PAYMENT_OVERDUE

The last payment failed more than 72 hours ago, so new renders are paused.

Update your card under Plan & billing (Manage billing). Renders resume once paid.

402PAYMENT_DISPUTED

The payment for this period is disputed, so the allowance is on hold.

Contact support at /support to resolve the dispute.

402AVATAR_CREDITS_INSUFFICIENT

The avatar balance does not cover the requested video length.

Buy an avatar credit pack in the Studio under Billing, or send a shorter script.

400INVALID_PAYLOAD

The JSON body failed the schema check. error.details names each field and what is wrong with it.

Fix the fields named in error.details. Do not retry the same body unchanged.

400VALIDATION_FAILED

A field has a value this model does not accept, for example a video aspect ratio other than 16:9 or 9:16, or an image URL that is not public HTTPS.

Fix the field named in the message and retry.

400MODEL_NOT_AVAILABLE

The model is not sold. Video: veo-3.1-lite. Images: nano-banana-2, nano-banana-2.1, nano-banana-pro. Avatars: avatar-3.

Use one of the listed models (GET /v1/models).

400CONTENT_POLICY_VIOLATION

The prompt or an input image was refused by the content check. Image calls answer 422 when the model refuses after starting. Nothing is counted.

Change the prompt or the image. Real people, minors, sexual content, violence, public figures and copyrighted characters are the usual reasons. Do not resend the same content.

400VOICE_UNAVAILABLE

Avatars: this voice_id cannot be used right now.

Pick a voice from GET /v1/avatar/catalog, leave voice_id out to use the avatar’s own voice, or send audio_url.

400AVATAR_MODEL_COMING_SOON

Avatar 4 is not on sale yet.

Send model "avatar-3".

400INVALID_AVATAR_NAME

POST /v1/avatar/custom: the name field is missing.

Send a name for the new avatar.

400MISSING_PORTRAIT_SOURCE

POST /v1/avatar/custom: no photo was sent.

Send photo_url (a public https:// image) or photo_base64.

202MODERATION_HELD

The prompt was flagged by an automatic check and waits for a short review.

Nothing is counted while it waits. You are notified of the outcome.

404NOT_FOUND

The task, render or resource does not exist on this account.

Check the id. Tasks are visible only to the account that created them.

404TASK_NOT_FOUND

GET /v1/tasks/{id} found no task with this id on your account.

Use the task_id from the answer of the create call, with a key of the same account.

404TOKEN_NOT_FOUND

No API key with this id on your account.

List your keys with GET /v1/tokens and use one of their ids.

409IDEMPOTENT_OPERATION_IN_FLIGHT

A request with the same Idempotency-Key is still being accepted.

Wait a second and retry with the same key; you then get the answer and task id of the first request.

409IDEMPOTENCY_CONFLICT

This Idempotency-Key was already used for a request that did not create a task.

Send the request again with a new Idempotency-Key.

429CONCURRENCY_LIMIT

The API already runs as many renders as your plan allows at once.

Wait for one to finish (poll GET /v1/tasks/{id}) and retry.

429AVATAR3_CONCURRENCY_LIMIT

Your account already runs as many avatar renders at once as it may.

Wait for one to finish (poll GET /v1/avatar/tasks/{id}) and retry.

429AVATAR3_DAILY_BUDGET_EXHAUSTED

Your avatar minutes for the last 24 hours are used up. The body has next_refill_at.

Retry after next_refill_at, or send a shorter script.

429RATE_LIMIT_EXCEEDED

This key sent more requests per minute than it may.

Wait until X-RateLimit-Reset (seconds) has passed, then retry with backoff.

429RATE_LIMITED

Too many requests in a short time (Studio).

Wait and retry; the Retry-After header says how long.

429QUEUE_FULL

Studio only: too many renders are running or waiting.

Start more when some have finished.

429SAFETY_REFUSAL_COOLDOWN

Many of your recent renders were refused by the safety filter, so new renders are slowed down for a while: one at a time for 10 minutes after 6 refusals in 30 minutes (when at least a fifth of your finished renders were refused), and a 5-minute pause if 4 renders submitted in that time are refused too, then one at a time again. The body has retry_after, reason (paused or concurrency), tier, limits, resets_at and cooldown_until. cooldown_until is fixed when the limit starts and is the same on every answer. It is not a ban, and renders already queued keep running.

Change the prompts or input images before you retry. Common reasons for refusals: real people or minors, sexual content, violence, public figures and copyrighted characters. Two successful renders in a row end the one-at-a-time limit early; render and status responses carry a SAFETY_REFUSALS_HIGH entry in warnings[] (and an X-Avatarity-Warning header) from 3 refusals in 30 minutes on.

503BILLING_UNAVAILABLE

Usage accounting is briefly unavailable.

Retry in a moment with the same Idempotency-Key. Nothing was started or counted.

503CAPACITY_BUSY

Synchronous image calls (POST /v1/images/generations without async) only: the image could not start within the request, so nothing ran and nothing was counted. The response carries Retry-After and retry_after_seconds. Asynchronous jobs never get this answer: they wait in the queue instead.

Retry after Retry-After, or send async: true: the job is accepted with 202 and status "queued", starts by itself and finishes later.

200CAPACITY_TIMEOUT

Task error (GET /v1/tasks/{id}, webhooks): the job waited in the queue for 5.5 hours without starting. Jobs never fail just because the queue is busy; they wait, and only this upper bound ends the wait. Nothing was charged.

Submit the job again.