Grok Video
xAI Grok video model with normal/fun/spicy styles
功能特性
- Text-to-video generation
- Image-to-video generation
- Style modes (normal/fun/spicy)
- Fast generation
定价
| Mode | Credits |
|---|---|
| text-to-video | 30 (~$0.33) |
| image-to-video | 30 (~$0.33) |
端点
POST
/api/v1/videos/generate参数
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| model | string | 必需 | Must be "grok-video" |
| type | string | 可选 | "text-to-video" or "image-to-video" (default: text-to-video) |
| prompt | string | 必需 | Text prompt (3-5000 chars) |
| mode_option | string | 可选 | "normal", "fun", or "spicy" (default: normal) |
| aspect_ratio | string | 可选 | "16:9", "9:16", "1:1", "2:3", or "3:2" (text-to-video only) |
| image_urls | string[] | 可选 | Required for image-to-video; one public http/https URL only |
| input_image | string | 可选 | Deprecated. Alias for image_urls[0] |
请求示例
{
"model": "grok-video",
"type": "text-to-video",
"prompt": "A handheld shot of a bustling ramen alley at night",
"mode_option": "fun",
"aspect_ratio": "16:9"
}响应示例
{
"success": true,
"data": {
"task_id": "task_grok123",
"credits_used": 30,
"remaining_credits": 470,
"model": "grok-video"
}
}代码示例
curl -X POST https://gateway.bananapro.site/api/v1/videos/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-video",
"type": "text-to-video",
"prompt": "A handheld shot of a bustling ramen alley at night",
"mode_option": "fun",
"aspect_ratio": "16:9"
}'