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

# Seedance動画タスクを取得

> <ul><li>Seedance動画生成タスクの状態を照会します。</li><li>タスク完了後、result_url から動画リンクを取得できます。</li></ul>

<RequestExample>
  ```bash cURL theme={null} theme={null}
  curl --request GET \
    --url 'https://api.elkapi.com/v1/video/generations/task_abc123' \
    --header 'Authorization: Bearer <token>'
  ```

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

  url = "https://api.elkapi.com/v1/video/generations/task_abc123"
  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null} theme={null}
  const response = await fetch("https://api.elkapi.com/v1/video/generations/task_abc123", {
    method: "GET",
    headers: {
      "Authorization": "Bearer <token>"
    }
  });

  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {
    "code": "success",
    "message": "",
    "data": {
      "task_id": "task_abc123",
      "platform": "doubao-video",
      "action": "generate",
      "status": "SUCCESS",
      "progress": "100%",
      "result_url": "https://example.com/video.mp4",
      "created_at": 1760000000,
      "updated_at": 1760000060,
      "data": {
        "id": "upstream_task_id",
        "status": "succeeded",
        "content": {
          "video_url": "https://example.com/video.mp4"
        },
        "usage": {
          "completion_tokens": 123456,
          "total_tokens": 123456
        }
      }
    }
  }
  ```

  ```json 404 theme={null} theme={null}
  {
    "error": {
      "message": "task_not_exist",
      "type": "new_api_error",
      "param": "",
      "code": "task_not_exist"
    }
  }
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  すべてのエンドポイントで Bearer Token 認証が必要です。

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Path Parameters

<ParamField path="task_id" type="string" required>
  タスク作成エンドポイントが返す `id` または `task_id`。
</ParamField>

## Response

<ResponseField name="code" type="string">
  レスポンス状態。成功時は `success` です。
</ResponseField>

<ResponseField name="data.task_id" type="string">
  ElkAPI公開タスクID。
</ResponseField>

<ResponseField name="data.platform" type="string">
  タスクプラットフォーム。Seedance は通常 `doubao-video` です。
</ResponseField>

<ResponseField name="data.status" type="string">
  内部タスク状態。

  一般的な値:`SUBMITTED`、`QUEUED`、`IN_PROGRESS`、`SUCCESS`、`FAILURE`
</ResponseField>

<ResponseField name="data.progress" type="string">
  タスク進捗。

  例:`10%`、`50%`、`100%`
</ResponseField>

<ResponseField name="data.result_url" type="string">
  タスク成功後の結果動画URL。
</ResponseField>

<ResponseField name="data.data" type="object">
  `content.video_url`、`usage.total_tokens` などを含む可能性がある上流の生タスクデータ。
</ResponseField>
