跳转到主要内容
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-video-1.5-preview",
    "prompt": "将这张产品图生成电影感商业视频,轻微镜头推进",
    "images": ["https://example.com/product.jpg"],
    "seconds": "10",
    "aspect_ratio": "16:9"
  }'
{
  "id": "video_abc123def456",
  "object": "generation.task",
  "model": "grok-video-1.5-preview",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.toapis.com/llms.txt

Use this file to discover all available pages before exploring further.

  • 仅支持图生视频,不支持文生视频。
  • 必须传入且仅能传入 1 张公网参考图 URL。
  • 支持 10 秒和 15 秒视频。
  • 异步任务 API:提交后使用任务 ID 查询视频生成状态。
不要直接传入 base64 图片数据。请先使用 上传图片接口 上传本地图片,再将返回的公网 URL 放入 images

Authorizations

Authorization
string
必填
所有接口均需要 Bearer Token 认证。
Authorization: Bearer YOUR_API_KEY

Body

model
string
默认值:"grok-video-1.5-preview"
必填
固定使用 grok-video-1.5-preview
prompt
string
必填
描述参考图需要生成的动态效果、镜头运动和视觉方向。
images
string[]
必填
传入且仅传入 1 个公网图片 URL。
  • 最少:1
  • 最多:1
  • 支持 URL 协议:http://https://
seconds
string
默认值:"10"
视频时长。支持值:"10""15"
aspect_ratio
string
默认值:"16:9"
视频画面比例。支持值:16:99:163:22:31:1

Pricing

时长价格
10s$0.10 / request
15s$0.15 / request

Response

id
string
用于查询任务状态的任务 ID。
object
string
对象类型,固定为 generation.task
model
string
本次任务使用的模型名。
status
string
任务状态:queuedin_progresscompletedfailed

创建视频任务

curl --request POST \
  --url https://toapis.com/v1/videos/generations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-video-1.5-preview",
    "prompt": "将这张产品图生成电影感商业视频,轻微镜头推进",
    "images": ["https://example.com/product.jpg"],
    "seconds": "10",
    "aspect_ratio": "16:9"
  }'
{
  "id": "video_abc123def456",
  "object": "generation.task",
  "model": "grok-video-1.5-preview",
  "status": "queued",
  "progress": 0,
  "created_at": 1768380224,
  "metadata": {}
}

查询任务状态

使用返回的 id 调用 视频任务状态接口