# Lakukan polling tugas pembuatan video

**API:** Model API

**Endpoint:** `GET /api/v1/videos/generations/{task_id}`

Mengembalikan status tugas saat ini. Jika statusnya succeeded, outputs berisi URL media bertanda tangan (https://openapi.felo.ai/api/v1/media/{file_id}?exp=...&sig=...) yang dapat diunduh secara anonim. Lakukan polling dengan interval 5-10 detik; tugas itu sendiri tetap berjalan di latar belakang.

## Base URL

- `https://openapi.felo.ai` — Produksi

## Authentication

- `FeloBearerAuth` (http bearer) — Kunci API Felo dikirim sebagai `Authorization: Bearer <key>`.
- `FeloApiKey` (apiKey in header `X-API-Key`) — Kunci API Felo dikirim sebagai `X-API-Key: <key>`.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `task_id` | path | yes | string | ID tugas yang dikembalikan oleh POST /api/v1/videos/generations. |

## Responses

### 200 — Status tugas saat ini

**application/json**

Schema: `VideoGenerationTask` (`#/components/schemas/VideoGenerationTask`)

### 401 — Kunci API Felo tidak valid atau tidak ada

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 404 — Tugas tidak ditemukan untuk akun ini

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 503 — Layanan pembuatan sementara tidak tersedia

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

## Schema definitions

### GenerationError

`#/components/schemas/GenerationError`

```json
{
  "type": "object",
  "description": "Envelope error yang kompatibel dengan OpenAI.",
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "message",
        "type"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "invalid_request_error",
            "server_error"
          ]
        },
        "param": {
          "type": "string",
          "nullable": true
        },
        "code": {
          "type": "string"
        }
      }
    }
  }
}
```

### VideoGenerationTask

`#/components/schemas/VideoGenerationTask`

```json
{
  "type": "object",
  "required": [
    "task_id",
    "status",
    "kind",
    "outputs"
  ],
  "properties": {
    "task_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "interrupted"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "video"
      ]
    },
    "outputs": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "URL media bertanda tangan (unduhan anonim) jika berhasil; jika tidak, []."
      }
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": "string",
          "description": "Stable failure code, e.g. file_not_found."
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "description": "Ada saat tugas gagal."
    }
  }
}
```
