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

# Seedance query video task

> Query the status and result of a Seedance-compatible video task

Use the `id` returned at creation to query the task. The response preserves Seedance protocol fields, with the video URL in `content.video_url` after success.

<Tip>
  Poll every 10-15 seconds. If you set `return_last_frame: true`, the successful response also includes a last-frame URL that you can use to continue into another video segment.
</Tip>

## Polling example

```python Python theme={null}
import time
import requests

task_id = "cgt-20260730120000-a1b2c3"
url = f"https://api.haitoken.ai/v1/seedance/video/generations/{task_id}"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

while True:
    result = requests.get(url, headers=headers).json()
    status = result.get("status")
    if status == "succeeded":
        print(result["content"]["video_url"])
        break
    if status in ("failed", "cancelled", "expired"):
        error = result.get("error") or {}
        print(error.get("code"), error.get("message"))
        break
    time.sleep(5)
```


## OpenAPI

````yaml en/api-reference/video/seedance/openapi.json GET /v1/seedance/video/generations/{taskId}
openapi: 3.0.1
info:
  title: Default Module
  description: ''
  version: 1.0.0
servers: []
security: []
tags: []
paths:
  /v1/seedance/video/generations/{taskId}:
    get:
      tags: []
      summary: Query task (seedance compatible protocol response)
      description: |-
        <p>
        seedance compatible query payload
      parameters:
        - name: taskId
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: API Key token (Bearer sk-xxx)
          required: true
          example: 'Bearer '
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceQueryTaskResponse'
          headers: {}
      deprecated: false
      security: []
components:
  schemas:
    SeedanceQueryTaskResponse:
      type: object
      properties:
        created_at:
          type: integer
          description: Task creation time (Unix timestamp, seconds)
          format: int64
        updated_at:
          type: integer
          description: Task last update time (Unix timestamp, seconds)
          format: int64
        framespersecond:
          type: integer
          description: Generated video frame rate
        generate_audio:
          type: boolean
          description: >-
            Whether the generated video contains audio synchronized with the
            visuals. This parameter is only supported in seedance 2.0 & 2.0 fast
            and seedance 1.5 pro.

            true: the model outputs a video with synchronized audio.

            false: outputs a silent video.
        safety_identifier:
          type: string
          description: >-
            Unique identifier of the end user. If this parameter is set when
            creating the video generation task, the API returns it unchanged.
        service_tier:
          type: string
          description: 'Service tier: default online inference / flex offline inference'
        execution_expires_after:
          type: integer
          description: Task timeout threshold, in seconds
        draft_task_id:
          type: string
          description: >-
            Draft video task ID. Returned when generating a final video from a
            draft video
        id:
          type: string
          description: Task ID
        model:
          type: string
          description: Model name
        status:
          type: string
          description: >-
            Task status: queued / running / succeeded / failed / expired /
            cancelled
        error:
          $ref: '#/components/schemas/SeedanceError'
          description: Error information (returned when the task fails)
        content:
          $ref: '#/components/schemas/Content'
          description: Generated result content (returned when the task succeeds)
        usage:
          $ref: '#/components/schemas/Usage'
          description: Token usage statistics
        seed:
          type: integer
          description: Random seed
          format: int64
        resolution:
          type: string
          description: 'Generated video resolution: 480p / 720p / 1080p / 4k'
        ratio:
          type: string
          description: 'Generated video aspect ratio: 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9'
        duration:
          type: integer
          description: Generated video duration (seconds)
        frames:
          type: string
          description: >-
            Generated video frame count.

            Note: only one of duration and frames is returned. If a frame count
            is specified in the create video generation request, the frame count
            is returned.
        priority:
          type: integer
          description: Execution priority of the current request
        draft:
          type: boolean
          description: >-
            Whether the generated video is a draft video. This parameter is only
            returned by seedance 1.5 pro.

            true: the current output is a draft video.

            false: the current output is a standard video.
    SeedanceError:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error description
    Content:
      type: object
      properties:
        video_url:
          type: string
          description: Download URL of the generated video
        last_frame_url:
          type: string
          description: >-
            Download URL of the last frame image of the generated video.

            Returned when "return_last_frame": true is set in the create video
            generation task request.
    Usage:
      type: object
      properties:
        completion_tokens:
          type: integer
          description: Number of tokens consumed by the model for video output
          format: int64
        total_tokens:
          type: integer
          description: >-
            Total number of tokens for this request. For video models, input
            tokens are always 0, so total_tokens = completion_tokens.
          format: int64

````