1. Grok
梧柏API使用文档
WHBAI · Grok Imagine
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • Grok
    • openai 查询任务
      GET
    • 创建视频
      POST
    • 编辑视频
      POST
  • grok
    • openai 创建视频,图生
      POST
  • 数据模型
    • GetV1VideosIdResponse
    • PostV1VideosGenerationsRequest
    • PostV1VideosEditsRequest
    • NewApiError
  1. Grok

创建视频

POST
/v1/videos/generations
Grok Imagine 文生/图生视频(POST /v1/videos/generations)。xAI 官方原生 JSON 入口,模型如 grok-imagine-video。
提交后通过 GET /v1/videos/{id} 轮询。

网站中的模型与调用示例#

创建视频#

Grok Imagine 文生/图生视频(POST /v1/videos/generations)。xAI 官方原生 JSON 入口,模型如 grok-imagine-video。
提交后通过 GET /v1/videos/{id} 轮询。

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "aspect_ratio": {
      "description": "(\"1:1\" | \"16:9\" | \"9:16\")",
      "type": "string"
    },
    "duration": {
      "description": " [1, 15]",
      "type": "integer"
    },
    "image": {
      "description": "不能和reference_images一起用",
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Cannot be used with reference_images"
        }
      }
    },
    "model": {
      "description": "支持模型:grok-imagine-video、grok-imagine-video-1.5-preview,grok-1.5-video模型请使用POST /v1/videos",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "support models:grok-imagine-video、grok-imagine-video-1.5-preview,please use POST /v1/videos for the `grok-1.5-video` model"
        }
      }
    },
    "prompt": {
      "description": "提示词",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "Prompt"
        }
      }
    },
    "reference_images": {
      "description": "不能和reference_images一起用",
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "Cannot be used with reference_images"
        }
      }
    },
    "resolution": {
      "description": "(\"480p\" | \"720p\")",
      "type": "string"
    }
  },
  "required": [
    "model",
    "prompt",
    "resolution",
    "aspect_ratio",
    "duration"
  ]
}

响应示例 · 示例 1#

"{\r\n    \"model\": \"grok-imagine-video\",\r\n    \"prompt\": \"A serene lake at sunrise with mist rolling over the water\",\r\n    \"duration\": 4,\r\n    \"aspect_ratio\": \"16:9\",\r\n    \"resolution\": \"480p\",\r\n    // \"image\":{\r\n    //     \"url\":\"https://imageproxy.zhongzhuan.chat/api/proxy/image/bb9bd34363da4fa486c9e645a6b1349e.png\"\r\n    // }\r\n}"

tags#

[
  "Grok"
]

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Header 参数

Body 参数application/json必填

示例
{
    "model": "string",
    "prompt": "string",
    "resolution": "string",
    "aspect_ratio": "string",
    "duration": 0,
    "image": {},
    "reference_images": []
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/v1/videos/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "string",
    "prompt": "string",
    "resolution": "string",
    "aspect_ratio": "string",
    "duration": 0,
    "image": {},
    "reference_images": []
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "model": "grok-imagine-video",
    "prompt": "A serene lake at sunrise with mist rolling over the water",
    "duration": 4,
    "aspect_ratio": "16:9",
    "resolution": "480p"
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:06
上一页
openai 查询任务
下一页
编辑视频
Built with