Trang này chỉ có tiếng Anh.

Video

Video is a job. You get an id at once and poll for the result. The model is <provider>/<model>, for example xai/grok-imagine-video or openrouter/google/veo-3.1-fast.

EndpointUse
POST /v1/videosCreate, OpenAI dialect (videos.create). Answers 202.
POST /v1/videos/generationsCreate, xAI dialect (@ai-sdk/xai). Answers 200.
GET /v1/videos/{id}Status, in the dialect the job was created with
GET /v1/videos/{id}/contentThe video, once completed

Where Aile relays the download, the link in a completed job's status works without a key for an hour. Anyone holding it can download the video.

cURLcurl
1curl https://api.aile.sh/v1/videos \
2-H "Authorization: Bearer $AILE_KEY" \
3-H "Content-Type: application/json" \
4-d '{ "model": "xai/grok-imagine-video", "prompt": "a lighthouse at dusk", "seconds": "6" }'
5
6curl https://api.aile.sh/v1/videos/$VIDEO_ID -H "Authorization: Bearer $AILE_KEY"

Billing

  • You pay for the seconds you asked for, once the provider reports the video done. Lipsync and avatar models are the exception: you pay for the length produced (below). So is BytePlus Seedance: you pay the tokens it reports (below).
  • xAI's Grok Imagine models and openrouter/heygen/heygen-video-1 are priced per resolution: you pay the per-second price of the resolution you send, or of 480p when you send none. A resolution the model does not list is a 400. Listings show the dearest resolution. HeyGen Video 1 renders 2K text-to-video at 16:9 or 9:16 only; any other aspect_ratio at 2K is a 400.
  • A failed, empty or expired job is not charged. Jobs expire after 30 minutes by default.
  • The hold stays on your balance while the job runs, and counts toward the key's spend limit (a 402 once open jobs hold the rest of it).
  • A job id is readable only by keys of the account that created it.
  • size ("1280x720") passes through where the model supports it.
  • One input image is accepted as input_reference (JSON, or an uploaded file), image, or one first_frame in frame_images, as a data URL or an https URL. A text-to-video model refuses it with a 400.
  • Other references (last_frame, reference_images, reference_audios, keyframes, video, previous_job_id, and input_references) are a 400 before anything is held, never silently dropped, except on the lipsync, avatar and Seedance models that take them.
  • OpenRouter video models refuse a request for an audio track.
  • Gemini's Veo (gemini/veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.1-lite-generate-preview) is text-to-video only, 4, 6 or 8 seconds, with sound included in the price. Standard renders 720p or 1080p (1080p at 8 seconds only); Fast and Lite render 720p. The aspect ratio is 16:9 or 9:16. Anything else is a 400 before anything is held.
  • When a sharer's provider account turns out to have no quota for a model, the request is a 502 saying you were not charged, and that sharer stops being offered that model; a retry reaches another sharer.
  • A provider refusal you can fix (400, 404, 413, 422 …) passes through. One about the sharer's account is a 502 saying you were not charged. A 502 or 504 arrives as 503 with the real code in x-aile-status.
  • A key's pins and the routing headers choose the sharer here too. x-aile-provider must match the model's prefix, and x-aile-max-price does not apply to a per-second price.
  • Keyless x402 works here when the deployment enables it, except for lipsync, avatar and BytePlus Seedance models: you pay when the render starts, and a render that fails or expires is refunded to the wallet that paid. Poll the job by its id with no key.

Lipsync and avatar

Three sync.so models re-sync a video's lips to an audio track. openrouter/heygen/avatar-iv animates a photo to speak a script or an audio file, and lists at $0.05 per second. The length of the result comes from your media, so you name its length in seconds.

Lipsync modelGood forAt most, per secondAt 25 fps, aboutLongest seconds
sync/lipsync-2General use, fastest$0.12$0.065300
sync/lipsync-2-proFiner facial detail$0.20$0.109180
sync/sync-3Close-ups, hard angles, covered faces$0.32$0.17430

Lipsync is billed per frame produced. The prices above are at list.

sync/lipsync-2curl
1curl https://api.aile.sh/v1/videos \
2-H "Authorization: Bearer $AILE_KEY" \
3-H "Content-Type: application/json" \
4-d '{
5 "model": "sync/lipsync-2",
6 "seconds": 30,
7 "input_references": [
8 { "type": "video_url", "video_url": { "url": "https://example.com/clip.mp4" } },
9 { "type": "audio_url", "audio_url": { "url": "https://example.com/voice.wav" } }
10 ]
11}'
  • seconds is required: a whole number from 1 to the model's longest (180 on avatar-iv). Name it at or above your media's length.
  • On lipsync you pay for the frames in the finished video; if Aile cannot read the file, its length disagrees with the provider's, or it runs under 10 or over 240 frames a second, you pay the model's full per-second price for each second produced.
  • sync-3 is slow: about 10 to 15 minutes for 30 seconds.
  • A sharer on sync.so's free, Hobbyist or Hobby plan returns a watermarked video, and Aile cannot tell in advance.
  • On avatar you pay for the length produced, rounded up to a second.
  • Neither is ever more than seconds + 2% + 1 s (rounded up). A render longer than that is withheld and not charged. If no length can be found at all, you pay for the full seconds.
  • At most three of these renders can be open per account at once, and repeats are rate limited: after three in an hour that were withheld or ran past the job's 30 minutes, the next create is a 429.
  • video_url and audio_url must be https URLs the provider can fetch. Aile never fetches them. Send at most one of each kind.
  • Lipsync takes a video and an audio track, and renders at the video's size, so size, resolution and aspect_ratio are a 400. sync_mode is bounce, loop, cut_off, silence or remap; cut_off when you send none. prompt is ignored on lipsync.
  • Avatar takes one photo (an image_url reference, or input_reference) and either a script in prompt or an audio_url. voice_id picks the voice for a script.
  • A 400 saying the output is longer than the sharer's plan renders means: send shorter media.
  • These models need an API key. Keyless x402 answers 401.

BytePlus Seedance

ByteDance's Seedance models, served from a sharer's BytePlus ModelArk account.

ModelSecondsAt most, per second
byteplus/dreamina-seedance-2-5-2606284 to 30480p $0.107, 720p $0.233, 1080p $0.572
byteplus/dreamina-seedance-2-0-2601284 to 15480p $0.070, 720p $0.152, 1080p $0.377, 4k $0.778
byteplus/dreamina-seedance-2-0-fast-2601284 to 15480p $0.056, 720p $0.122
byteplus/dreamina-seedance-2-0-mini-2606154 to 15480p $0.035, 720p $0.076
byteplus/seedance-1-0-pro-2505282 to 12480p $0.024, 720p $0.056, 1080p $0.122
byteplus/seedance-1-0-pro-fast-2510152 to 12480p $0.010, 720p $0.023, 1080p $0.049
  • You pay the tokens BytePlus reports. The hold is the price above times seconds, priced at the widest frame for that resolution, so a 16:9 video costs a little less. Prices are at list.
  • seconds defaults to 5. resolution defaults to 720p, or 1080p on the 1.0 models.
  • Every model takes a first frame. The 2.5 and 2.0 models also take a last_frame, up to 30 (2.5) or 9 (2.0) reference images and up to 10 or 3 reference audio clips. 1.0 pro takes a last_frame only.
  • Send references as input_references (image_url and audio_url items), reference_images or reference_audios. A frame and references cannot be mixed. A reference video is a 400.
  • aspect_ratio is 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 or adaptive.
  • The 2.5 and 2.0 models add sound unless you send generate_audio: false, at the same price. The 1.0 models are silent.
  • BytePlus refuses reference images that show real faces.
  • These models need an API key. Keyless x402 answers 401.