# 列出可用模型

**API:** Model API

**Endpoint:** `GET /api/v1/models`

預設會傳回所有模型類別，包括 chat、image_generation、video_generation 與 decisions。模型必須已啟用、已上架、未刪除，且具備目前的價格（零為有效值）。選用的供應商篩選條件會保留既有的價格與對應條件。結果會先依管理員的 sort_order 遞增排序，再依模型名稱與 ID 排序。新同步的模型會保持隱藏，直到管理員將其列為上架。隱藏只會影響探索清單；停用則會連新的呼叫一併拒絕。模型詳細資料查詢維持不變。選擇呼叫端點前，請先讀取 model_kind：video_generation 使用 /api/v1/videos/generations；decisions 使用 /api/v1/decisions。專用的探索清單位於 /api/v1/videos/models 與 /api/v1/decisions/models。設定 exclude_video_and_decisions=true，即可在套用供應商類別覆寫後排除影片與決策模型；圖片模型仍符合資格。

## Base URL

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

## Authentication

- `FeloBearerAuth` (http bearer) — 以 `Authorization: Bearer <key>` 形式傳送的 Felo API 金鑰。
- `FeloApiKey` (apiKey in header `X-API-Key`) — 以 `X-API-Key: <key>` 形式傳送的 Felo API 金鑰。

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `exclude_video_and_decisions` | query | no | boolean, default: false | 選用的供應商篩選條件，例如 ephone 或 openrouter。 |

## Responses

### 200 — 可用模型

**application/json**

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

### 401 — Felo API 金鑰無效或未提供

**application/json**

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

### 422 — 查詢參數無效，例如 provider 為空或布林值不正確

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    }
  }
}
```

### 503 — 模型目錄暫時無法使用

**application/json**

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

## Schema definitions

### Model

`#/components/schemas/Model`

```json
{
  "type": "object",
  "required": [
    "id",
    "object",
    "created",
    "owned_by"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Felo 模型 ID。"
    },
    "object": {
      "type": "string",
      "const": "model"
    },
    "created": {
      "type": "integer",
      "format": "int64",
      "description": "模型目錄建立時間戳記，單位為 Unix 秒。"
    },
    "owned_by": {
      "type": "string"
    },
    "model_kind": {
      "type": "string",
      "description": "套用已啟用的供應商對應覆寫後，實際生效的模型能力類別：chat、image_generation、video_generation 或 decisions。請使用與此類別相符的呼叫端點。"
    }
  },
  "additionalProperties": true
}
```

### ModelList

`#/components/schemas/ModelList`

```json
{
  "type": "object",
  "required": [
    "object",
    "data"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "list"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Model"
      }
    }
  },
  "additionalProperties": true
}
```

### OpenAIErrorResponse

`#/components/schemas/OpenAIErrorResponse`

```json
{
  "type": "object",
  "description": "相容於 OpenAI 的錯誤封裝。Router 可能只包含 code 與 message，而不含所有選用的上游欄位。",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "description": "相容於 OpenAI 的錯誤類型（若有提供）。"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
```
