> ## 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.

# Get video · Vertex AI project path

> Check task status, handle failures and find the completed video.

Use the same project, location, publisher and model as creation, and pass back the complete `operationName` unchanged.

## Polling and status

Replace `<OPERATION_NAME>` with the full `name` from creation and poll every 10 to 15 seconds:

```bash theme={"system"}
curl "https://api.aiohub.org/v1/projects/<PROJECT>/locations/<LOCATION>/publishers/bytedance/models/doubao-seedance-2-5-260628:fetchPredictOperation" \
  -H "Authorization: Bearer <AIOHUB_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"operationName": "<OPERATION_NAME>"}'
```

| Response | Action |
| - | - |
| `done: false` | Keep polling |
| `done: true` with `response` | Download the video |
| `done: true` with `error` | Stop polling and read `error.message` |

`done: true` means the operation ended, not necessarily that it succeeded.

## Read a successful result

Key fields in a successful response:

```json theme={"system"}
{
  "name": "projects/<PROJECT>/locations/<LOCATION>/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example",
  "done": true,
  "response": {
    "videos": [
      {
        "gcsUri": "https://api.aiohub.org/v1/videos/task_example/content",
        "mimeType": "video/mp4"
      }
    ]
  }
}
```

`response.videos[0].gcsUri` is an AIOHub HTTPS URL, not a `gs://` object. Download with an HTTP client; Google Cloud Storage is not required.

After success, [download the video](/en/api/video-content).

## Failures and retries

After a polling disconnect, keep polling the same `name` rather than calling `predictLongRunning` again. Correct fields before retrying a 400. If a terminal operation has `error`, do not read the success response fields. Files remain for 72 hours and task records for 7 days.

After a 429 or temporary service error, wait before retrying the read; do not create another task. If a task is missing, check the identifier and the account that owns the API key.


## OpenAPI

````yaml openapi/relay.en.json POST /v1/projects/{project}/locations/{location}/publishers/{publisher}/models/{model}:fetchPredictOperation
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1/projects/{project}/locations/{location}/publishers/{publisher}/models/{model}:fetchPredictOperation:
    post:
      tags:
        - Video generation
      summary: Get Vertex video task with project path
      description: >
        Keep polling while done is false. When done is true, check error first;
        read error.message on failure and response on success. Task records
        remain readable for 7 days.


        Download from response.videos[0].gcsUri, an authenticated HTTPS URL.
      operationId: getSeedanceVertexVideoWithProject
      parameters:
        - name: project
          in: path
          required: true
          description: Project identifier in the client's path.
          schema:
            type: string
            example: my-project
          example: my-project
        - name: location
          in: path
          required: true
          description: Location identifier in the client's path.
          schema:
            type: string
            example: us-central1
          example: us-central1
        - name: publisher
          in: path
          required: true
          description: Model publisher; Seedance examples use bytedance.
          schema:
            type: string
            example: bytedance
          example: bytedance
        - name: model
          in: path
          required: true
          description: Full Seedance model name.
          schema:
            type: string
            example: doubao-seedance-2-5-260628
          example: doubao-seedance-2-5-260628
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operationName:
                  type: string
                  description: Pass the complete name from creation unchanged.
              required:
                - operationName
            example:
              operationName: >-
                projects/my-project/locations/us-central1/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example
      responses:
        '200':
          description: Current task state; generation failures can also return HTTP 200.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceVertexOperation'
              examples:
                pending:
                  summary: Pending
                  value:
                    name: >-
                      projects/my-project/locations/us-central1/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example
                    done: false
                succeeded:
                  summary: Succeeded
                  value:
                    name: >-
                      projects/my-project/locations/us-central1/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example
                    done: true
                    response:
                      videos:
                        - gcsUri: >-
                            https://api.aiohub.org/v1/videos/task_example/content
                          mimeType: video/mp4
                failed:
                  summary: Failed
                  value:
                    name: >-
                      projects/my-project/locations/us-central1/publishers/bytedance/models/doubao-seedance-2-5-260628/operations/task_example
                    done: true
                    error:
                      message: Video generation failed
        '400':
          description: >-
            Invalid fields, types or model capability. Correct the request using
            code and message before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceTaskError'
        '401':
          description: Missing or invalid API key.
        '404':
          description: Task not found or not owned by this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceTaskError'
      security:
        - BearerAuth: []
components:
  schemas:
    SeedanceVertexOperation:
      type: object
      properties:
        name:
          type: string
          description: Full operation name. Save the returned value for polling.
        done:
          type: boolean
          description: >-
            False means pending. True means finished, possibly with a failure;
            check error.
        response:
          type: object
          properties:
            '@type':
              type: string
              description: Response type.
            videos:
              type: array
              items:
                type: object
                properties:
                  gcsUri:
                    type: string
                    description: >-
                      An AIOHub HTTPS download URL, not a gs:// object;
                      authentication is required.
                    format: uri
                  mimeType:
                    type: string
                    enum:
                      - video/mp4
                required:
                  - gcsUri
                  - mimeType
        error:
          type: object
          properties:
            message:
              type: string
              description: Generation failure reason.
          required:
            - message
      required:
        - name
        - done
    SeedanceTaskError:
      type: object
      description: Error response of the video task endpoints.
      properties:
        code:
          type: string
          description: Error code
          example: invalid_duration
        message:
          type: string
          description: Error message
          example: duration must be between 4 and 30 seconds for this model
  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.