> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiohub.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建视频 · Vertex AI 项目路径

> 通过包含 project 和 location 的 Vertex AI 路径创建 Seedance 视频。

客户端携带 project 和 location 时使用这个路径。使用 AIOHub API 令牌鉴权；`publisher` 示例为 `bytedance`，`model` 填完整 Seedance 模型名。

## 请求示例

```bash theme={"system"}
curl "https://api.aiohub.org/v1/projects/<PROJECT>/locations/<LOCATION>/publishers/bytedance/models/doubao-seedance-2-5-260628:predictLongRunning" \
  -H "Authorization: Bearer <AIOHUB_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "instances": [{
      "prompt": "A blue ceramic cup on a wooden table in daylight."
    }],
    "parameters": {
      "durationSeconds": 4,
      "aspectRatio": "16:9",
      "resolution": "720p",
      "generateAudio": true,
      "sampleCount": 1
    }
  }'
```

返回的关键字段如下。保存完整 `name`，包括模型路径和 `operations/`，不要只保存最后一段 ID。

```json theme={"system"}
{
  "name": "projects/<PROJECT>/locations/<LOCATION>/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example",
  "done": false
}
```

保存完整 `name`，随后使用 [项目路径查询接口](/cn/api/video-vertex-project-get)。

## 输入与参数

未指定参数时，默认 5 秒、720p、`adaptive` 比例并生成音频。首尾帧与参考图是两种输入方式，不能在同一个 `instances[0]` 中混用。

图片对象示例：

```json theme={"system"}
{"bytesBase64Encoded": "<BASE64_IMAGE>", "mimeType": "image/png"}
```

模型上限见 [视频模型与计费](/cn/api/video-models)。不支持任意 `gs://` 输入、视频扩展或全部 Veo 参数。需要参考音频、参考视频或视频编辑时，选择 [Ark / Seedance](/cn/api/video-ark)。


## OpenAPI

````yaml openapi/relay.json POST /v1/projects/{project}/locations/{location}/publishers/{publisher}/models/{model}:predictLongRunning
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub 公开 API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: 获取模型列表
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: 图片生成
  - name: OpenAI 图像
  - name: 视频生成
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: 文本补全
  - name: OpenAI 音频
  - name: Realtime API
paths:
  /v1/projects/{project}/locations/{location}/publishers/{publisher}/models/{model}:predictLongRunning:
    post:
      tags:
        - 视频生成
      summary: 创建 Vertex 视频任务（项目路径）
      description: |
        本页描述 Seedance 的 Vertex 视频格式，模型范围见 [模型与计费](/cn/api/video-models)。

        创建成功返回 name 和 done: false。保存完整 name，每 10 到 15 秒查询一次。HTTP 200 不代表视频生成完成。
      operationId: createSeedanceVertexVideoWithProject
      parameters:
        - name: project
          in: path
          required: true
          description: 客户端路径中的项目标识。
          schema:
            type: string
            example: my-project
          example: my-project
        - name: location
          in: path
          required: true
          description: 客户端路径中的区域标识。
          schema:
            type: string
            example: us-central1
          example: us-central1
        - name: publisher
          in: path
          required: true
          description: 模型发布者，Seedance 示例使用 bytedance。
          schema:
            type: string
            example: bytedance
          example: bytedance
        - name: model
          in: path
          required: true
          description: 完整 Seedance 模型名。
          schema:
            type: string
            example: doubao-seedance-2-5-260628
          example: doubao-seedance-2-5-260628
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SeedanceGoogleVideoRequest'
            examples:
              text:
                summary: 文生视频
                value:
                  instances:
                    - prompt: A blue ceramic cup on a wooden table in daylight.
                  parameters:
                    durationSeconds: 4
                    aspectRatio: '16:9'
                    resolution: 720p
                    generateAudio: true
                    sampleCount: 1
      responses:
        '200':
          description: 任务已受理。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceVertexOperation'
              example:
                name: >-
                  projects/my-project/locations/us-central1/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example
                done: false
        '400':
          description: 字段、类型或模型能力不匹配。根据 code 和 message 修正后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceTaskError'
        '401':
          description: API 令牌缺失或无效。
        '429':
          description: 请求过多或容量已满，等待后重试。
        '503':
          description: 模型在所选分组不可用，或服务暂时不可用。
      security:
        - BearerAuth: []
components:
  schemas:
    SeedanceGoogleVideoRequest:
      type: object
      properties:
        instances:
          type: array
          minItems: 1
          maxItems: 1
          description: 只提交一个实例。文本生成需 prompt；图生视频可指定 image。
          items:
            type: object
            properties:
              prompt:
                type: string
                description: 提示词。纯文本生成时必填。
              image:
                $ref: '#/components/schemas/SeedanceGoogleImage'
              lastFrame:
                $ref: '#/components/schemas/SeedanceGoogleImage'
              referenceImages:
                type: array
                minItems: 1
                maxItems: 30
                items:
                  $ref: '#/components/schemas/SeedanceGoogleReferenceImage'
                description: 2.5 最多 30 张，2.0 系列最多 9 张；不能与 image、lastFrame 混用。
        parameters:
          type: object
          properties:
            durationSeconds:
              type: integer
              minimum: 4
              maximum: 30
              default: 5
              description: 整数秒。2.5 为 4 到 30，2.0 系列为 4 到 15。
            aspectRatio:
              type: string
              description: 默认 adaptive。Seedance 2.5 首尾帧输入只能使用 adaptive。
              enum:
                - adaptive
                - '16:9'
                - '4:3'
                - '1:1'
                - '3:4'
                - '9:16'
                - '21:9'
              default: adaptive
            resolution:
              type: string
              description: 取值依模型。4k 仅用于 2.0 标准版，1080p 不适用于 fast/mini。
              enum:
                - 480p
                - 720p
                - 1080p
                - 4k
              default: 720p
            generateAudio:
              type: boolean
              default: true
              description: 是否生成音频。
            sampleCount:
              type: integer
              enum:
                - 1
              default: 1
              description: 每个任务只生成一个视频。
            numberOfVideos:
              type: integer
              enum:
                - 1
              description: sampleCount 的别名；指定时必须为 1。
      required:
        - instances
      description: >-
        本页参数范围针对 Seedance。lastFrame 必须与 image
        一起使用；参考图不可与首尾帧混用。不能传入视频扩展、mask、seed、negativePrompt 等未列出的控制参数。
    SeedanceVertexOperation:
      type: object
      properties:
        name:
          type: string
          description: 完整 operation name。保存原值用于后续查询。
        done:
          type: boolean
          description: false 表示等待；true 表示已结束，但可能是失败，须检查 error。
        response:
          type: object
          properties:
            '@type':
              type: string
              description: 响应类型。
            videos:
              type: array
              items:
                type: object
                properties:
                  gcsUri:
                    type: string
                    description: AIOHub HTTPS 下载地址，不是 gs:// 对象；下载需要 API 令牌。
                    format: uri
                  mimeType:
                    type: string
                    enum:
                      - video/mp4
                required:
                  - gcsUri
                  - mimeType
        error:
          type: object
          properties:
            message:
              type: string
              description: 生成失败原因。
          required:
            - message
      required:
        - name
        - done
    SeedanceTaskError:
      type: object
      description: 视频任务接口的错误响应。
      properties:
        code:
          type: string
          description: 错误码
          example: invalid_duration
        message:
          type: string
          description: 错误信息
          example: duration must be between 4 and 30 seconds for this model
    SeedanceGoogleImage:
      type: object
      properties:
        bytesBase64Encoded:
          type: string
          description: 图片文件的 base64 内容，不带 data URL 前缀。
        mimeType:
          type: string
          description: 图片 MIME 类型，例如 image/png 或 image/jpeg。
          example: image/png
      required:
        - bytesBase64Encoded
        - mimeType
    SeedanceGoogleReferenceImage:
      type: object
      properties:
        image:
          $ref: '#/components/schemas/SeedanceGoogleImage'
        referenceType:
          type: string
          description: 使用 asset。不能与首尾帧输入混用。
          enum:
            - asset
          default: asset
      required:
        - image
        - referenceType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.