Grok Imagine Video

Grok视频生成按请求档位定价

Grok Imagine Video (xAI). Two uses: make a 1-15 second clip at 480p or 720p from text, from one picture as the first frame, or from 2-7 reference pictures (then at most 10 seconds); or edit a video you already have: send one mp4 of at most 8.7 seconds in videos with a prompt saying what to change, and get the same clip back with the change (same length and aspect ratio, up to 720p). Price: 480p $0.044 and 720p $0.0616 per output second, plus $0.00176 per picture; an edit is $0.0704 per second of the source video. For plain generation grok-imagine-1.5-video is 3-4 times cheaper but cannot take a video.

价格

$0.0392/秒

Max

$0.03528/秒

端点

/videos

交付模式

异步任务生命周期

可用状态

当前可用

API 文档

配置并复制请求

选择这个模型支持的选项,下面的代码会实时更新。

在文档里一步步看
POSThttps://apiking.ai/v1/videosBearer API key异步任务

选项这里只展示当前模型已公开支持的选项。

# Requires curl and jq
API_KEY="${API_KEY:-YOUR_API_KEY}"

# 1. Submit once
SUBMITTED=$(curl --fail-with-body -sS https://apiking.ai/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: model-docs-$(date +%s)-$$" \\
  -d '{
  "model": "Grok Imagine Video",
  "prompt": "A cinematic scene with careful composition",
  "duration": 8,
  "resolution": "480p",
  "size": "auto",
  "nsfw_check": false
}')
TASK_ID=$(printf '%s' "$SUBMITTED" | jq -r '.task_id // .id // empty')
if [ -z "$TASK_ID" ]; then
  printf '%s\n' "$SUBMITTED" >&2
  exit 1
fi
echo "task_id=$TASK_ID"

# 2. Poll until terminal
while true; do
  STATUS_JSON=$(curl --fail-with-body -sS \
    "https://apiking.ai/v1/videos/$TASK_ID" \
    -H "Authorization: Bearer $API_KEY")
  STATUS=$(printf '%s' "$STATUS_JSON" | jq -r '.status // empty' | tr '[:upper:]' '[:lower:]')
  echo "status=$STATUS"
  case "$STATUS" in
    completed|succeeded|success) break ;;
    failed|failure|cancelled|canceled)
      printf '%s\n' "$STATUS_JSON" | jq .
      exit 1
      ;;
  esac
  sleep 5
done

# 3. Fetch the final result
curl --fail-with-body -sS \
  "https://apiking.ai/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer $API_KEY" | jq .
  1. 1提交任务
  2. 2轮询状态
  3. 3获取结果内容

该模型要求使用公网媒体地址。 先上传本地文件,再把 public_url 放入模型请求;避免发送大体积 Base64 请求体。

查看上传指南

参数说明

model
string必填

本次请求使用的精确模型标识。

grok-imagine-video
prompt
string必填

What to make; for an edit, what to change and what must stay the same. Up to 8000 characters.

duration
integer可选

Output seconds, 1 to 15; at most 10 with 2 or more pictures. Not used for an edit: the output is as long as the source video.

resolution
string可选

480p ($0.044 per second) or 720p ($0.0616 per second). Not used for an edit: the output keeps the source video's resolution, up to 720p.

480p720p
size
string可选

Aspect ratio. With one picture the clip takes the picture's shape. Not used for an edit: the output keeps the source video's.

auto16:99:161:14:33:43:22:3
images
string[]可选

Up to 7 public picture URLs, $0.00176 each. One picture is the first frame; 2 to 7 are references for a clip of at most 10 seconds. Not together with videos.

videos
string[]可选

Edit a video: one public mp4 URL of at most 8.7 seconds. You get the same clip back with the change the prompt asks for, at $0.0704 per second of the source video. Not together with images.

响应流程

查看任务状态、终态和结果响应示例。

提交
{
  "id": "task_xxx",
  "task_id": "task_xxx",
  "object": "video",
  "model": "Grok Imagine Video",
  "status": "queued"
}

等待中

queued · submitted · in_progress · processing

成功

completed · succeeded · success

失败

failed · failure · cancelled · canceled

错误与生产配置

查看重试规则、幂等要求和最小生产检查清单。

400 / 422

修正请求字段或不支持的选项,不要原样重试。

401

检查 API 密钥是否存在、有效,并已通过 Bearer Token 发送。

402

账户余额不足。

409

Idempotency-Key 正在处理中,或已被其他请求体使用。

429

按照 Retry-After 退避后再重试。

5xx

使用指数退避重试,并保留原始 Idempotency-Key。

  • 面向公众的移动端和浏览器应用应把 API 密钥保存在服务端。
  • 为每个会计费的异步操作设置唯一 Idempotency-Key。
  • 持久保存 task_id,以便重启后恢复轮询。
  • 为每个 HTTP 请求设置超时,并在支持工单中提供请求 ID。
  • 读取实时模型元数据,不要硬编码价格和支持选项。

价格与档位

标价,所有人都是这个价。

按秒计价 · 480p

$0.0392/秒

档位定价

按生成内容的秒数计费。

每张输入图片(含首帧图)加 $0.001568。

分辨率价格
480p$0.0392/秒
720p$0.05488/秒
改视频(按原视频每秒)价格
  • 任意原视频$0.06272/秒

页面展示的价格即实际计费价格,调用失败会自动退款。

Grok Imagine Video 一览

模型 ID
Grok Imagine Video
类型
视频生成
厂商
Grok
分辨率
480p · 720p
画面比例
16:9 · 9:16 · 1:1 · 4:3 · 3:4 · 3:2 · 2:3
时长
1–15 秒
参考素材
最多 7 张图片 · 最多 1 段视频
端点
POST /v1/videos
返回方式
异步任务:轮询或接收 webhook 通知
计费方式
按输出秒数

常见问题

Grok Imagine Video API 多少钱?

在 APIKing 上,Grok Imagine Video 的价格是 $0.0392/秒。 按用量从余额中扣费。

怎么调用 Grok Imagine Video API?

向 https://apiking.ai/v1/videos 发请求,用你的 APIKing 密钥作为 Bearer 令牌,并把 model 设为 Grok Imagine Video。 调用会返回一个任务。轮询它直到完成,或设置 webhook 在完成时通知你。

Grok Imagine Video 的模型 ID 是什么?

把 model 参数设为 Grok Imagine Video。

Grok Imagine Video 支持哪些分辨率和时长?

分辨率:480p, 720p。 时长:1 到 15 秒。

Grok Imagine Video 能用参考图或参考视频生成吗?

支持。参考素材:最多 7 张图片 · 最多 1 段视频。

Grok Imagine Video 调用失败会扣费吗?

调用失败、生成失败都不收钱。任务先预估,完成后按实际用量结算。

Grok Imagine Video 与同类模型对比

模型厂商价格规格
Grok Imagine VideoGrok$0.0392/秒 起最高 720p · 最长 15 秒
Wan 3.0Wan$0.028109/秒 起最高 1080P · 最长 30 秒
Grok Imagine 1.5 VideoGrok$0.009996/秒 起最高 720p · 最长 15 秒
Muse Video ExtMeta$0.02305 / 次最高 720p · 最长 10 秒
Seedance 2.0 Mini字节跳动$0.016381/秒 起最高 720p · 最长 15 秒
Seedance 2.5字节跳动$0.086712/秒 起最高 1080p · 最长 30 秒