curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-video-1.5-preview",
"prompt": "霓虹灯照亮的夜晚街道,镜头在雨中缓慢向前推进",
"duration": 6,
"quality": "480p",
"aspect_ratio": "16:9"
}
'{
"created": 1757169743,
"id": "task-unified-1757169743-7cvnl5zw",
"model": "grok-imagine-video-1.5-preview",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 120
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 26.66,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: grok-imagine-video-1.5-preview",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Grok
Grok Imagine 1.5 视频生成 Preview
- Grok Imagine 1.5 (grok-imagine-video-1.5-preview) 模型用同一个模型名支持文生视频、图生视频和参考生视频
- 没有 mode 参数:由
image_urls的图片张数决定模式 ——0张 = 文生视频,1张 = 图生视频(作为首帧),2-7张 = 参考生视频 - 异步处理模式,使用返回的任务ID 进行查询
- 生成的视频链接,有效期为24小时,请尽快保存
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-video-1.5-preview",
"prompt": "霓虹灯照亮的夜晚街道,镜头在雨中缓慢向前推进",
"duration": 6,
"quality": "480p",
"aspect_ratio": "16:9"
}
'{
"created": 1757169743,
"id": "task-unified-1757169743-7cvnl5zw",
"model": "grok-imagine-video-1.5-preview",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 120
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 26.66,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: grok-imagine-video-1.5-preview",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}授权
##所有接口均需要使用Bearer Token进行认证##
获取 API Key :
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
模型名称
可用选项:
grok-imagine-video-1.5-preview 示例:
"grok-imagine-video-1.5-preview"
视频描述提示词(必填,不可为空)
长度限制: 不超过 4096 字符
示例:
"The person starts dancing"
输入图片 URL(选填)。图片张数决定生成模式。
模式选择:
0张(不传该字段):文生视频,不收取图片费用1张:图生视频,该图作为首帧2-7张:参考生视频,多图融合
要求:
- 最多
7张图片,8张及以上会被拒绝 - 图片大小:单张不超过
10MB - 支持格式:JPEG、PNG、WebP
Maximum array length:
7示例:
["https://example.com/image.jpg"]
视频时长(秒),范围 1 ~ 15 秒任意整数
必填范围:
1 <= x <= 15示例:
6
视频清晰度,默认为480p
说明:
480p: 标准清晰度,此为默认值720p: 高清晰度1080p: 全高清
参考生视频(2-7 张图)最高支持 720p。 传 2 张及以上图片时使用 1080p 会被拒绝。1080p 仍可用于文生视频与单图的图生视频。
可用选项:
480p, 720p, 1080p 示例:
"480p"
输出画幅比例,默认为auto
适用范围: 文生视频(0 张图)与参考生视频(2-7 张图)。只传 1 张输入图时,输出画幅跟随该图尺寸,本参数不生效。
说明:
auto: 由模型决定画幅,不同次生成可能不同,此为默认值16:9: 横屏9:16: 竖屏1:1: 方形3:2: 横屏,经典照片比例2:3: 竖屏,经典照片比例
可用选项:
auto, 16:9, 9:16, 1:1, 3:2, 2:3 示例:
"16:9"
任务完成后的HTTPS回调地址
回调时机:
- 任务完成(completed)、失败(failed)或取消(cancelled)时触发
- 在计费确认完成后发送
安全限制:
- 仅支持HTTPS协议
- 禁止回调到内网IP地址(127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x等)
- URL长度不超过
2048字符
回调机制:
- 超时时间:
10秒 - 失败后最多重试
3次(会分别在失败的1秒/2秒/4秒后进行重试) - 回调响应体格式与任务查询接口返回的格式一致
- 回调地址若返回2xx状态码视为成功,其他状态码会触发重试
示例:
"https://your-domain.com/webhooks/video-task-completed"
响应
视频任务创建成功
任务创建时间戳
示例:
1757169743
任务ID
示例:
"task-unified-1757169743-7cvnl5zw"
实际使用的模型名称
示例:
"grok-imagine-video-1.5-preview"
任务的具体类型
可用选项:
video.generation.task 任务进度百分比 (0-100)
必填范围:
0 <= x <= 100示例:
0
任务状态
可用选项:
pending, processing, completed, failed 示例:
"pending"
视频任务详细信息
Show child attributes
Show child attributes
任务的输出类型
可用选项:
text, image, audio, video 示例:
"video"
使用量和计费信息
Show child attributes
Show child attributes