AI Video
Text-to-video generation with status polling and cancellation.
Overview
https://api.infrai.cc/v1/videoAuthorization: Bearer $INFRAI_API_KEY# Call any /v1/video capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/video/... \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json"Methods
video.generate
Start a text-to-video generation job.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | Text description of the desired video. |
reference_image_url | string | Optional | Optional reference image URL. |
duration_seconds | number | Optional | Clip duration in seconds. |
aspect | "16:9" | "9:16" | "1:1" | Optional | Aspect ratio. |
resolution | "720p" | "1080p" | "4k" | Optional | Output resolution (720p/1080p/4k); gated per vendor. |
prefer | "balanced" | "cheapest" | "smartest" | Optional | Optimization axis: balanced (best value) | cheapest | smartest. |
idempotency_key | string | Optional | Optional dedup key; identical retries return the same result. |
Returns
VideoJob { job_id, state, video_url?, thumbnail_url?, error? }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/video/generate \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a timelapse of a city skyline at dusk", "prefer": "balanced", "resolution": "1080p", "duration_seconds": 5, "aspect_ratio": "16:9"}'video.status
Poll the status of a video job.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
Returns
VideoJobExample
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/video/status/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"video.cancel
Cancel a running video job.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
Returns
{ ok: boolean }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/video/cancel/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"job_id": "..."}'video.get
获取视频任务的完整详情(状态、视频地址、时长、分辨率、厂商、模型等)。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
Returns
VideoJob { job_id, state, video_url?, thumbnail_url?, duration_seconds, resolution, vendor, model, error? }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/video/get/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"video.list
分页列出当前账户的视频生成任务。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | Optional | 分页游标,取自上一页返回的 next_cursor。 |
limit | number | Optional | 单页返回的最大任务数。 |
Returns
VideoJobPage { items: VideoJob[], next_cursor?: string }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/video/list \
-H "Authorization: Bearer $INFRAI_API_KEY"video.delete
删除指定视频任务及其产物(幂等写)。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
idempotency_key | string | Optional | Optional dedup key; identical retries return the same result. |
Returns
{ ok: boolean }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X DELETE https://api.infrai.cc/v1/video/delete/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"video.delete_all
批量删除当前账户的全部视频任务及其产物。
Returns
{ deleted: number }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/video/delete_all \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'video.download_url
为指定视频任务签发带过期时间的临时下载链接。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
Returns
{ url: string, expires_at: string }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/video/download_url/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"video.set_retention
设置单个视频任务的保留窗口(天),上限 90 天。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job identifier. |
days | number | Required | 保留窗口天数,正整数,硬上限 90 天。 |
idempotency_key | string | Optional | Optional dedup key; identical retries return the same result. |
Returns
{ job_id: string, retention_days: number, expires_at: string }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/video/set_retention/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"job_id": "...", "days": 0}'video.capabilities
查询各视频厂商支持的模型、分辨率、最大时长及扩展/超分能力。
Returns
VideoCapabilities { vendors: Array<{ vendor, models, resolutions, max_duration_seconds, supports_extend, supports_upscale }> }Example
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/video/capabilities \
-H "Authorization: Bearer $INFRAI_API_KEY"All capabilities
Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.
| Capability | Endpoint | Description |
|---|---|---|
video.cancel | POST /v1/video/cancel/{id} | Cancel an in-progress video generation job. |
video.capabilities | GET /v1/video/capabilities | Query each video provider's supported models, resolutions, max duration, and extend/upscale capabilities. |
video.delete | DELETE /v1/video/delete/{id} | Delete a video job and its artifacts (idempotent write). |
video.delete_all | POST /v1/video/delete_all | Bulk-delete all video jobs and their artifacts for the current account. |
video.download_url | GET /v1/video/download_url/{id} | Issue a time-limited, expiring download URL for a video job's output. |
video.generate | POST /v1/video/generate | Generate a video from a text or image prompt asynchronously (idempotent). |
video.get | GET /v1/video/get/{id} | Retrieve a video job's full details (status, video URL, duration, resolution, provider, model). |
video.list | GET /v1/video/list | List the current account's video generation jobs with pagination. |
video.set_retention | POST /v1/video/set_retention/{id} | Set a video job's retention window in days, up to a 90-day maximum. |
video.status | GET /v1/video/status/{id} | Query a video generation job's status and output URL. |
End-to-end example
A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."# 1) Auth: every call is a raw HTTPS request to the Infrai gateway carrying
# only your project key. No SDK, no install.
# Get your key: sign in with Google/GitHub at the console for a project key
# + $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..." # from the console
# 2) video.generate
curl -X POST https://api.infrai.cc/v1/video/generate \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a timelapse of a city skyline at dusk", "prefer": "balanced", "resolution": "1080p", "duration_seconds": 5, "aspect_ratio": "16:9"}'
# 3) video.status
curl -X GET https://api.infrai.cc/v1/video/status/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 4) video.cancel
curl -X POST https://api.infrai.cc/v1/video/cancel/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"job_id": "..."}'
# 5) video.get
curl -X GET https://api.infrai.cc/v1/video/get/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 6) video.list
curl -X GET https://api.infrai.cc/v1/video/list \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 7) video.delete
curl -X DELETE https://api.infrai.cc/v1/video/delete/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 8) video.delete_all
curl -X POST https://api.infrai.cc/v1/video/delete_all \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
# 9) video.download_url
curl -X GET https://api.infrai.cc/v1/video/download_url/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"