跳转到主要内容
POST
/
v1beta
/
models
/
{model}
:predictLongRunning
Gemini predictLongRunning
curl --request POST \
  --url http://sandbox.mintlify.com/v1beta/models/{model}:predictLongRunning \
  --header 'Content-Type: application/json' \
  --header 'x-goog-api-key: <api-key>' \
  --data '
{
  "instances": [
    {
      "prompt": "一只小猫在花园中奔跑"
    }
  ],
  "parameters": {
    "durationSeconds": 5,
    "aspectRatio": "16:9"
  }
}
'
{
  "name": "operations/abc123",
  "done": false,
  "metadata": {
    "progressPercent": 0
  }
}
用于提交 Veo 等长任务式视频生成请求。
  • 官方常见鉴权方式是 x-goog-api-key: {API_KEY},也支持查询参数 API Key
  • 这个接口返回的是 long-running operation 句柄,不是最终视频内容
  • 提交成功后要保存 operation 名称或 ID,供后续轮询使用
  • 后续需要查询 /v1beta/operations/{operation_id} 才能知道任务是否完成

授权

x-goog-api-key
string
header
必填

路径参数

model
string
必填

Gemini model name.

示例:

"veo-3.0-generate-preview"

请求体

application/json
instances
object[]
必填
parameters
object

响应

Successful long-running operation creation response

name
string
metadata
object
done
boolean
response
object
error
object