跳转到主要内容
POST
/
generate
/
k
/
grok-text-to-video
Grok 文本转视频
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/grok-text-to-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A cat playing with a ball in slow motion",
  "aspect_ratio": "2:3",
  "mode": "normal"
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
使用 xAI 的 Grok Imagine 模型从文本生成短视频。 模型特点:
  • 极速生成 - 15 秒内完成视频生成,速度优于 Sora 2
  • 音视频同步 - 原生集成音频生成,自动添加音效和背景音乐
  • 流畅动作 - 24fps 流畅帧率,复杂动作无变形
  • 智能运镜 - 支持动态镜头效果和智能焦点切换

Authorizations

Authorization
string
header
required

请使用您的 API Token 进行认证

Body

application/json

任务参数

prompt
string
required

提示词(必填)

Required string length: 1 - 5000
Example:

"A cat playing with a ball in slow motion"

aspect_ratio
enum<string>
default:2:3

宽高比(可选,默认 2:3)

可用选项:
2:3,
3:2,
1:1
Example:

"2:3"

mode
enum<string>
default:normal

模式(可选,默认 normal)

可用选项:
fun,
normal,
spicy
Example:

"normal"

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"