# 列出可用模型

**API:** Model API

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

默认返回所有模型类别，包括 chat、image_generation、video_generation 和 decisions。模型必须已启用、已上架、未删除，并且具有当前定价（零是有效值）。可选的 provider 筛选会保留现有的定价与映射条件。结果先按管理员的 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 | 可选的 provider 筛选，例如 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
}
```
