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.
| Endpoint | Use |
|---|---|
POST /v1/videos | Create, OpenAI dialect (videos.create). Answers 202. |
POST /v1/videos/generations | Create, xAI dialect (@ai-sdk/xai). Answers 200. |
GET /v1/videos/{id} | Status, in the dialect the job was created with |
GET /v1/videos/{id}/content | The 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.
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" }'56curl 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.
- 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
402once 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 onefirst_frameinframe_images, as a data URL or an https URL. A text-to-video model refuses it with a400. - Other references (
last_frame,reference_images,reference_audios,keyframes,video,input_references,previous_job_id) are a400before anything is held, never silently dropped. - OpenRouter video models refuse a request for an audio track.
- A provider refusal you can fix (
400,404,413,422…) passes through. One about the lender's account is a502saying you were not charged. A502or504arrives as503with the real code inx-aile-status. - A key's pins and the routing headers choose the lender here too.
x-aile-providermust match the model's prefix, andx-aile-max-pricedoes not apply to a per-second price. - An API key is required. Keyless x402 does not cover video.