# ตรวจสอบสถานะงานสร้างวิดีโอ

**API:** Model API

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

คืนสถานะงานปัจจุบัน เมื่อ status เป็น succeeded ฟิลด์ outputs จะมี URL สื่อที่ลงลายเซ็นแล้ว (https://openapi.felo.ai/api/v1/media/{file_id}?exp=...&sig=...) ซึ่งดาวน์โหลดได้โดยไม่ต้องยืนยันตัวตน ให้ตรวจสอบซ้ำทุก 5-10 วินาที ตัวงานยังคงดำเนินการต่อในเบื้องหลัง

## Base URL

- `https://openapi.felo.ai` — โปรดักชัน

## Authentication

- `FeloBearerAuth` (http bearer) — คีย์ API ของ Felo ที่ส่งมาในรูปแบบ `Authorization: Bearer <key>`
- `FeloApiKey` (apiKey in header `X-API-Key`) — คีย์ API ของ Felo ที่ส่งมาในรูปแบบ `X-API-Key: <key>`

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `task_id` | path | yes | string | ID ของงานที่คืนมาจาก POST /api/v1/videos/generations |

## Responses

### 200 — สถานะงานปัจจุบัน

**application/json**

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

### 401 — คีย์ API ของ Felo ไม่ถูกต้องหรือไม่มี

**application/json**

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

### 404 — ไม่พบงานนี้ในบัญชีของคุณ

**application/json**

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

### 503 — บริการสร้างผลงานไม่พร้อมใช้งานชั่วคราว

**application/json**

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

## Schema definitions

### GenerationError

`#/components/schemas/GenerationError`

```json
{
  "type": "object",
  "description": "ซองข้อผิดพลาดที่เข้ากันได้กับ 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 สื่อที่ลงลายเซ็นแล้ว (ดาวน์โหลดโดยไม่ต้องยืนยันตัวตน) เมื่อสำเร็จ มิฉะนั้นเป็น []"
      }
    },
    "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": "มีค่าเมื่องานล้มเหลว"
    }
  }
}
```
