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

# getGenerateVideosOperation

> 查询视频生成任务的状态和结果。

查询长时间运行的视频生成任务的状态和结果。


## OpenAPI

````yaml GET /v1beta/projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model}/operations/{operation_id}
openapi: 3.1.0
info:
  title: TokenOps AI API
  description: TokenOps AI API 提供了强大的AI服务能力，包括聊天对话、Gemini模型集成等功能。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://model-api.skyengine.com.cn
    description: TokenOps AI API 生产环境
security: []
paths:
  /v1beta/projects/{project_id}/locations/{location}/publishers/{publisher}/models/{model}/operations/{operation_id}:
    get:
      summary: 获取视频生成操作状态
      description: 查询视频生成任务的状态和结果。
      operationId: getGenerateVideosOperation
      parameters:
        - name: project_id
          in: path
          required: true
          description: 项目ID
          schema:
            type: string
            example: my-project
        - name: location
          in: path
          required: true
          description: 地理位置
          schema:
            type: string
            example: us-central1
        - name: publisher
          in: path
          required: true
          description: 发布者
          schema:
            type: string
            example: google
        - name: model
          in: path
          required: true
          description: 模型名称
          schema:
            type: string
            example: veo-3.1-generate-preview
        - name: operation_id
          in: path
          required: true
          description: 操作ID，从predictLongRunning接口返回的操作名称中提取
          schema:
            type: string
            example: >-
              projects/my-project/locations/us-central1/operations/operation-123456789
      responses:
        '200':
          description: 成功获取操作状态
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateVideosOperation'
        '400':
          description: 客户端错误（包括操作不存在、权限不足等）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GenerateVideosOperation:
      type: object
      properties:
        name:
          type: string
          description: 操作名称
          example: >-
            projects/my-project/locations/us-central1/operations/operation-123456789
        metadata:
          type: object
          description: 操作元数据
          additionalProperties: true
        done:
          type: boolean
          description: 操作是否完成
          example: false
        error:
          $ref: '#/components/schemas/Status'
          description: 错误信息（如果操作失败）
        response:
          $ref: '#/components/schemas/GenerateVideosResponse'
          description: 视频生成响应（如果操作成功完成）
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Status'
          description: 错误信息
    Status:
      type: object
      properties:
        code:
          type: integer
          description: 错误代码
        message:
          type: string
          description: 错误消息
        details:
          type: array
          description: 错误详情
          items:
            type: object
            additionalProperties: true
    GenerateVideosResponse:
      type: object
      properties:
        generatedVideos:
          type: array
          description: 生成的视频列表
          items:
            $ref: '#/components/schemas/GeneratedVideo'
    GeneratedVideo:
      type: object
      properties:
        uri:
          type: string
          description: 生成视频的URI（当视频存储在云存储时返回）
          example: https://my-bucket/generated-videos/video-123.mp4
        videoBytes:
          type: string
          description: Base64编码的视频数据（当视频以内联方式返回时）
          format: byte
        mimeType:
          type: string
          description: 视频的MIME类型
          example: video/mp4
        createTime:
          type: string
          format: date-time
          description: 创建时间
      description: 生成的视频可以通过URI访问或直接包含base64编码的视频数据
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        ModelHub API密钥认证。在 `Authorization` HTTP Header 中包含您的 API-Key，格式为 `Bearer
        {API_KEY}`

````