# 生成されたメディアファイルをダウンロード（匿名）

**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) | 出力 URL に含まれる署名の有効期限（Unix 秒）。 |
| `sig` | query | yes | string | 出力 URL に含まれる HMAC 署名。 |

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