Atmee.aiDocs
APIAPI referenceGeneration

Generate a clip

POST
/v1/generation/clips

Renders a short mp4 (1 to 15 seconds, 25 fps) of the person or character in image, moving as prompt describes and optionally speaking audio. No avatar is needed.

  • Inputs: image is a portrait upload or a public https link (jpg, png or webp, up to 10 MB); audio is a voice upload or link. The audio plays once from the start, padded with silence or cut at the end. The prompt and the image are moderated; if the image shows a real person other than you, get their permission first.
  • Duration: durationSeconds is required with audio (set it to the audio's length; the file is not measured) and defaults to 8 for a silent clip; 1 to 15 seconds at every size.
  • Resolution: 480 × 480 unless you pass resolution, the clip's output size, one of the sizes in ClipResolution (listed with their prices in pricing.generation.clipSizes on GET /v1/account). 1080p sizes are coming soon.
  • Output: the clip as upload:<uploadId> (kept 24 hours), with a short-lived url to download it.
  • Billing: a price per clip set by its size and its length tier: up to 5, 10 or 15 seconds, charged at the next length up, so a 7-second clip pays the up-to-10-seconds price (pricing.generation.clipPrices). Charged only when the clip comes back.
  • Slow starts: a cold render can take minutes. After about 45 seconds the call answers 409 request_in_progress and the render goes on. Follow it with GET /v1/generation/clips/{requestId} (the Idempotency-Key is the request id, and the 409 names that path in Location), or retry this call with the same key after Retry-After to get the clip, charged once.
  • Access: video clips are on every plan, Free included, and need no Atmee V2 access or invite code (building Atmee V2 avatars needs Pro and up, or an invite code below Pro). They spend credits by length and size; any credits pay for them. An account whose video generation is turned off answers 403 video_generation_not_in_plan (limits.videoGeneration on GET /v1/account); an older billing setup may still answer 403 v2_access_required.
  • Scope: generation:write. A clip is not avatar editing, so it needs no avatar scope: with generation:write alone a key can upload the clip's portrait and voice (POST /v1/uploads), make the clip, and read it back (GET /v1/generation/clips/{requestId}, GET /v1/uploads/{uploadId}).
ErrorWhen
400 invalid_inputA bad input, audio without durationSeconds, or an input the renderer cannot use: input_failure image or audio (no face, an unreadable file), a size that is not a clip size or not served here yet (the message lists the sizes), input_failure resolution (a size the renderer cannot serve right now)
503 generation_unavailableClips are not offered here

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Header Parameters

Idempotency-Key*string

A new UUID minted for this request. Reuse it only to retry the same request: a retry never charges twice and returns the first result. A malformed key, or a key already used with different inputs, gets 400 invalid_input.

Lengthlength <= 255

Request Body

application/json
  1. body
image*string

Who or what the clip shows, upload:<uploadId> (a portrait upload) or a public https link (jpg, png or webp, at most 10 MB).

Length1 <= length <= 2048
prompt*string

The shot and the motion, e.g. "she walks along the beach at sunset, the camera following".

Length1 <= length <= 2000
audio?string

What the clip says or plays, upload:<uploadId> (a voice upload) or a public https link to an audio file. Absent, the clip is silent.

Length1 <= length <= 2048
durationSeconds?integer

The clip's length, 1 to 15 at every size. Required with audio (set it to the audio's length; it is not read from the file); default 8 for a silent clip.

Range1 <= value <= 15
resolution?

A clip's output size in pixels, one of these. Credits per clip by length; a clip pays the next length up (7 seconds pays the up-to-10-seconds price):

SizeSizesUp to 5 sUp to 10 sUp to 15 s
480p square, 4:3, 3:4480 x 480, 640 x 480, 480 x 6400.10.30.5
480p 16:9, 9:16832 x 468, 468 x 8320.30.71
720p square, 4:3, 3:4720 x 720, 960 x 720, 720 x 9600.511.5
720p 16:9, 9:161280 x 720, 720 x 12800.81.42
1080panycoming soon

Default 480 x 480. The renderer works at each side rounded up to a multiple of 32 (1280 x 720 at 1280 x 736) and crops the centre to the size asked for. GET /v1/account pricing.generation.clipSizes lists the sizes served here with their prices; another size is 400 invalid_input, naming the sizes.

seed?integer

The render's seed; another seed gives other motion. Default 0.

Formatint64
Range0 <= value

Response Body

The clip (or the replayed first result).

application/json
  1. response
clip*
microcreditsCharged*integer

What this call charged to credits (100 microcredits = 1 credit), the clip's price for its size and length tier (pricing.generation.clipPrices); 0 on a replay.

microcreditsFree*integer

Always 0. A plan's free generation allowance does not cover clips; the field is here so every generation answer has the same shape.

replayed*boolean

True when an earlier call with the same Idempotency-Key was replayed.

Example Request
curl -X POST 'https://api.atmanity.us/v1/generation/clips' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "image": "string",  "prompt": "string"}'
Example Response
{  "clip": {    "upload": "upload:3f1c2a9e-8d4b-4f6a-9c2e-1b7d5a0e4c11",    "url": "http://example.com",    "expiresAt": "2019-08-24T14:15:22Z",    "durationSeconds": 0,    "width": 0,    "height": 0,    "unavailable": true  },  "microcreditsCharged": 0,  "microcreditsFree": 0,  "replayed": true}