> ## 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 · Ark / Seedance

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

## Polling and status

Replace `<TASK_ID>` with the returned `id` and poll every 10 to 15 seconds:

```bash theme={"system"}
curl "https://api.aiohub.org/v1/contents/generations/tasks/<TASK_ID>" \
  -H "Authorization: Bearer <AIOHUB_API_KEY>"
```

| `status` | Action |
| - | - |
| `queued` / `running` | Keep polling |
| `succeeded` | Download the video |
| `failed` / `cancelled` / `expired` | Stop polling and read `error.message` when present |

Generation can take several minutes. Check the task status even when polling returns HTTP 200.

## Read a successful result

Key fields in a successful response are shown below. Use the URL returned by your request:

```json theme={"system"}
{
  "id": "task_example",
  "status": "succeeded",
  "content": {
    "video_url": "https://api.aiohub.org/v1/videos/task_example/content"
  }
}
```

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

## Failures and retries

After a disconnect, keep polling the original `id`. Task records remain for 7 days. If a task is missing, check the identifier and use a key belonging to the account that created it. Stop on `failed`, `cancelled` or `expired`.

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 GET /v1/contents/generations/tasks/{task_id}
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/contents/generations/tasks/{task_id}:
    get:
      tags:
        - Video generation
      summary: Get a video task
      description: >
        Returns the current state of the task. Poll every 10 to 15 seconds. When
        `status` is `succeeded`, `content.video_url` is downloadable for 72
        hours. Task records stay readable for 7 days.
      operationId: getSeedanceVideoTask
      parameters:
        - name: task_id
          in: path
          required: true
          example: task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ
          schema:
            type: string
          description: The `id` returned when the task was created
      responses:
        '200':
          description: Task object
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceTask'
              example:
                id: task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ
                model: doubao-seedance-2-5-260628
                status: succeeded
                error: null
                content:
                  video_url: >-
                    https://api.aiohub.org/v1/videos/task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ/content
                usage:
                  completion_tokens: 87300
                  total_tokens: 87300
                output_format: mp4
                framespersecond: 24
                resolution: 720p
                ratio: '16:9'
                duration: 4
                generate_audio: true
                priority: 0
                service_tier: default
                execution_expires_after: 172800
                created_at: 1791275108
                updated_at: 1791275315
        '404':
          description: >-
            Unknown task ID, or a task owned by another API key. `code` is
            `task_not_exist`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceTaskError'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    SeedanceTask:
      type: object
      description: Video task object.
      properties:
        id:
          type: string
          description: Task ID
          example: task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ
        model:
          type: string
          example: doubao-seedance-2-5-260628
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
            - expired
          description: Task status
        error:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SeedanceTaskError'
          description: Error when the task did not succeed, otherwise `null`.
        content:
          type: object
          nullable: true
          description: >-
            Artifact URLs when `status` is `succeeded`. Download with the same
            API key.
          properties:
            video_url:
              type: string
              example: >-
                https://api.aiohub.org/v1/videos/task_ADQ5XK6AKWg36WePoJ3sZRyDvWl1ogGZ/content
            last_frame_url:
              type: string
              description: >-
                Present only when the task was created with `return_last_frame:
                true`.
        usage:
          type: object
          properties:
            completion_tokens:
              type: integer
              description: >-
                Billed video tokens of the delivered video. See [Video
                generation](/en/api/video#pricing).
            total_tokens:
              type: integer
        output_format:
          type: string
          example: mp4
        framespersecond:
          type: integer
          example: 24
        resolution:
          type: string
          description: >-
            The requested value while running; the delivered value after
            success.
        ratio:
          type: string
          description: >-
            The requested value while running; the delivered value after
            success.
        duration:
          type: integer
          description: >-
            The requested value while running; the delivered value after
            success.
        generate_audio:
          type: boolean
        priority:
          type: integer
        service_tier:
          type: string
          example: default
        execution_expires_after:
          type: integer
          example: 172800
        safety_identifier:
          type: string
        created_at:
          type: integer
          description: Creation time, Unix seconds
        updated_at:
          type: integer
          description: Last update time, Unix seconds
    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.