快速调用
Base URL:
https://api1.link-ai.cc/v1。创建任务成功后,通常每 3–5 秒查询一次状态。POST
https://api1.link-ai.cc/v1/videoscurl -X POST "https://api1.link-ai.cc/v1/videos" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "video-pro-720p",
"prompt": "cinematic product commercial, smooth camera movement",
"duration": 6,
"aspect_ratio": "16:9"
}'
图生视频
curl -X POST "https://api1.link-ai.cc/v1/videos" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "video-pro-720p",
"prompt": "the subject slowly turns toward the camera",
"duration": 6,
"image": "https://your-cdn.com/reference.jpg",
"aspect_ratio": "16:9"
}'
常用模型
模型和权限可能随渠道调整,请以控制台模型列表或 GET /v1/models 的实时结果为准。
video-fast-480pvideo-mini-720pvideo-standard-720pvideo-fast-720pvideo-fast-720p-cheapvideo-pro-480pvideo-pro-720pvideo-pro-720p-cheapvideo-ultra-720pvideo-pro-1080pveo-3-1veo-omni-flashveo-omni-flash-video-editgrok-imagine-video-1.5-fastgrok-imagine-video-1.5-previewsora2
创建任务返回
提交成功会返回公开任务 ID。请保存 id 或 task_id,后续使用它查询进度。
{
"id": "task_xxxxxxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxxxxxx",
"object": "video",
"model": "video-pro-720p",
"status": "queued",
"progress": 0,
"created_at": 1785230000
}
查询任务
GET
https://api1.link-ai.cc/v1/videos/{task_id}curl "https://api1.link-ai.cc/v1/videos/task_xxxxxxxxxxxxxxxxx" \ -H "Authorization: Bearer sk-xxxxxxxx"
完成示例
{
"id": "task_xxxxxxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxxxxxx",
"object": "video",
"model": "video-pro-720p",
"status": "completed",
"progress": 100,
"video_url": "https://cdn.example.com/generated/video.mp4",
"cover_url": "https://cdn.example.com/generated/cover.jpg",
"output": [
{"type": "video", "url": "https://cdn.example.com/generated/video.mp4"}
]
}
生成结果 URL 可能有有效期。任务完成后请尽快下载并转存到你自己的对象存储。
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型 ID。可只替换模型名切换速度、清晰度或渠道。 |
prompt | string | 是 | 视频内容描述;使用参考素材时应明确描述运动与镜头。 |
duration | integer | 否 | 视频秒数。可用值由模型决定,平台安全上限为 60 秒。 |
aspect_ratio | string | 否 | 常用值:16:9、9:16、1:1、4:3、3:4。 |
size | string | 否 | 部分模型使用尺寸,如 1280x720 或 720x1280。 |
image | string | 否 | 单张公网 HTTPS 参考图 URL。 |
images | string[] | 否 | 多张参考图 URL。数量限制取决于模型。 |
extra_videos | string[] | 否 | 部分 Omni/编辑模型支持的参考视频。 |
extra_audios | string[] | 否 | 部分模型支持的参考音频。 |
metadata | object | 否 | 供应商特定扩展参数。 |
状态与错误
| 状态 | 含义 | 建议 |
|---|---|---|
queued / pending | 等待处理 | 继续轮询,建议间隔 3–5 秒。 |
in_progress / processing | 生成中 | 读取 progress 展示进度。 |
completed | 任务完成 | 从 video_url 或 output 获取结果。 |
failed / cancelled | 任务失败 | 读取 error.message,修正参数后重试。 |
{
"error": {
"message": "模型不可用或请求参数不受支持",
"type": "invalid_request_error",
"code": "upstream_error"
}
}