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

# Klingテキスト動画タスク状態を取得

> <ul><li>Klingテキスト動画タスクの状態と結果を照会します。</li></ul>

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

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

  url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890"
  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.request("GET", url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null} theme={null}
  const url = "https://api.elkapi.com/kling/v1/videos/text2video/task_1234567890";

  const headers = {
    "Authorization": "Bearer <token>"
  };

  const response = await fetch(url, { method: "GET", headers });
  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {
    "task_id": "task_1234567890",
    "status": "completed",
    "url": "https://example.com/image.png",
    "format": "mp4",
    "metadata": {
      "duration": 5,
      "fps": 30,
      "width": 1280,
      "height": 720,
      "seed": 12345
    },
    "error": {
      "code": 1,
      "message": "message"
    }
  }
  ```

  ```json 404 theme={null} theme={null}
  {
    "error": {
      "message": "message",
      "type": "type",
      "param": "param",
      "code": "code"
    }
  }
  ```
</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
</ParamField>

## Response

<ResponseField name="task_id" type="string">
  タスクID

  例:`abcd1234efgh`
</ResponseField>

<ResponseField name="status" type="string">
  タスク状態

  指定可能な値:`queued`、`in_progress`、`completed`、`failed`

  例:`completed`
</ResponseField>

<ResponseField name="url" type="string">
  動画リソースURL（成功時）

  例:`https://example.com/video.mp4`
</ResponseField>

<ResponseField name="format" type="string">
  動画形式

  例:`mp4`
</ResponseField>

<ResponseField name="metadata" type="object">
  動画タスクメタデータ

  <ResponseField name="metadata.duration" type="number">
    実際に生成された動画の長さ

    例:`5`
  </ResponseField>

  <ResponseField name="metadata.fps" type="integer">
    実際のフレームレート

    例:`30`
  </ResponseField>

  <ResponseField name="metadata.width" type="integer">
    実際の幅

    例:`1280`
  </ResponseField>

  <ResponseField name="metadata.height" type="integer">
    実際の高さ

    例:`720`
  </ResponseField>

  <ResponseField name="metadata.seed" type="integer">
    使用したランダムシード

    例:`20231234`
  </ResponseField>
</ResponseField>

<ResponseField name="error" type="object">
  動画タスクエラー情報

  <ResponseField name="error.code" type="integer">
    エラーコード
  </ResponseField>

  <ResponseField name="error.message" type="string">
    エラーメッセージ
  </ResponseField>
</ResponseField>
