Veo 3.1
概览
模型标识符: veo-3.1 · 输出: video · 模式: Text to Video, Image to Video
认证与接口
所有请求发送到 https://genjutsu.top。请将 Genjutsu API 密钥作为 bearer 令牌发送。 POST https://genjutsu.top/v1/media/generate · Authorization: Bearer $GENJUTSU_API_KEY · 所需权限范围: generate, read, assets
模式与参数
Text to Video t2v
| 参数 | 类型 | 是否必填 | 默认值 | 详情 |
|---|---|---|---|---|
prompt | string | 必填 | - | |
aspect_ratio | 可选值之一 | 可选 | "9:16" |
|
duration | 可选值之一 | 可选 | 8 |
|
video_upscale | 可选值之一 | 可选 | "none" |
|
最小请求
curl -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "veo-3.1",
"mode": "t2v",
"params": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light"
}
}'包含可选参数的请求
curl -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "veo-3.1",
"mode": "t2v",
"params": {
"count": 1,
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light",
"duration": 8,
"aspect_ratio": "9:16",
"video_upscale": "none"
}
}'Image to Video i2v
| 参数 | 类型 | 是否必填 | 默认值 | 详情 |
|---|---|---|---|---|
prompt | string | 必填 | - | |
video_mode | 可选值之一 | 可选 | "image-to-video" |
|
image_url | image 资源 ID | 必填 | - | |
end_image_url |
任务生命周期
将请求提交到 POST /v1/media/generate,返回 202 和 task_id。每 5 秒轮询一次 GET /v1/media/tasks/{task_id},直到 is_final 为 true:此时状态为 succeeded、failed 或 cancelled,同一个任务中包含结果(outputs)或错误(error_code 和 error_message)。使用相同的 Idempotency-Key 重复提交会返回原任务。响应中的 ID 和 URL 仅为示例。
# Needs curl and jq.
# 1. Submit. The response is 202 with task_id, state and credits_held.
ID=$(curl -s -X POST "https://genjutsu.top/v1/media/generate" \
-H "Authorization: Bearer $GENJUTSU_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "veo-3.1",
"mode": "t2v",
"params": {
"prompt": "A lighthouse on a rocky cliff at golden hour, soft clouds, cinematic light"
}
}' | jq -r .task_id)
echo "task: $ID"
# 2. Poll every 5 seconds until is_final is true (state is then succeeded, failed or cancelled).
while true; do
TASK=$(curl -s "https://genjutsu.top/v1/media/tasks/$ID" -H "Authorization: Bearer $GENJUTSU_API_KEY")
echo "state: $(echo "$TASK" | jq -r .state)"
[ "$(echo "$TASK" | jq -r .is_final)" = "true" ] && break
sleep 5
done
# 3. The final task carries the result: outputs[].url when succeeded, error_code and error_message when failed.
echo "$TASK" | jq '{state, outputs, error_code, error_message, credits}'价格
Text to Video
| 选项 | 总价 |
|---|---|
Video upscaling: 720p | 每次请求 1.000000 点数 |
Video upscaling: 1080p | 每次请求 2.000000 点数 |
Video upscaling: 2K | 每次请求 3.000000 点数 |
Image to Video
| 选项 | 总价 |
|---|---|
Video upscaling: 720p | 每次请求 1.000000 点数 |
Video upscaling: 1080p | 每次请求 2.000000 点数 |
Video upscaling: 2K | 每次请求 3.000000 点数 |
请在 Studio 或通过 POST /v1/quotes 获取准确总价。
版本与说明
文档版本 4,发布于 2026-11-27。