# 下載生成的媒體檔案（匿名）

**API:** Model API

**Endpoint:** `GET /api/v1/media/{file_id}`

串流傳輸生成的影片（或圖片）檔案。此端點為匿名：身分驗證即為 URL 中的 HMAC 簽章。請一律使用任務 outputs 陣列中傳回的完整 URL；不要自行建構 exp/sig。支援 Range 請求以續傳。當簽章或上游 TTL 到期時，媒體會遭到移除或失效。

## Base URL

- `https://openapi.felo.ai` — 正式環境

## Authentication

No authentication required — this endpoint is anonymous.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `file_id` | path | yes | string, (uuid) | 來自任務輸出 URL 的已簽章檔案 ID。 |
| `exp` | query | yes | integer, (int64) | 簽章到期時間（Unix 秒），取自輸出 URL。 |
| `sig` | query | yes | string | HMAC 簽章，取自輸出 URL。 |

## Responses

### 200 — 媒體檔案

**application/octet-stream**

Schema: string, (binary)

```json
{
  "type": "string",
  "format": "binary"
}
```

**video/mp4**

Schema: string, (binary)

```json
{
  "type": "string",
  "format": "binary"
}
```

### 400 — 請求無效（例如不允許任意 ?url=）

**application/json**

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

### 403 — 簽章無效或已過期

**application/json**

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

### 404 — 未知的媒體檔案

**application/json**

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

### 410 — 媒體已過期，或上游已不再提供

**application/json**

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

### 429 — 此檔案已達速率限制

**application/json**

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

### 502 — 上游媒體擷取失敗

**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"
        }
      }
    }
  }
}
```
