> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# 发现 Comfy Router 模型

> 使用 GET /v2/models 列出 Comfy Router 目录，通过游标分页浏览，并按 ID 获取单个模型的条目。

每个 Router 模型都由形如 `{provider}/{model}` 的 ID 标识。使用目录找到该 ID，然后调用 `POST /v2/models/{provider}/{model}`。

<h2 id="discover-the-catalog">
  发现目录
</h2>

使用与生成时相同的 API 密钥列出模型：

```bash theme={null}
curl -H "X-API-Key: $COMFY_API_KEY" \
  "https://api.comfy.org/v2/models?limit=50"
```

简略的目录响应：

```json theme={null}
{
  "data": [
    {
      "id": "bfl/flux-2-pro",
      "provider": "bfl",
      "model": "flux-2-pro",
      "billing": { "charges_on_policy_rejection": "no" }
    }
  ],
  "has_more": true,
  "next_cursor": "example-cursor",
  "limit": 50
}
```

在调用路径中使用 `id`。`billing` 对象包含的是计费事实，而非价格。在依赖它之前，请先阅读[策略拒绝计费](/zh/development/comfy-router/billing#模型计费事实)。

<h3 id="pagination">
  分页
</h3>

* 当 `has_more` 为 `true` 时，将返回的 `next_cursor` 作为 `cursor` 传入。当 `has_more` 为 `false` 时停止，即使之前的某一页比请求的数量更短。
* 将游标视为不透明的值。对取值进行 URL 编码，例如使用 cURL 的 `--get --data-urlencode "cursor=$NEXT_CURSOR"`；不要计算偏移量，也不要修改游标。
* `limit` 默认为 20，上限为 100。超过上限的值会被截断；零和负数会选择默认值。响应会报告实际使用的 limit。
* 无效的游标会返回 `400` / `invalid_input`。它不会静默地重新开始列表。
* 游标在目录更新后可能仍然有效，但遍历并不是快照：在当前位置之前新增的模型可能不会出现在该次遍历中。

`503` / `service_unavailable` 是临时性的。请通过退避策略重试；不要将其视为空目录。SDK 的运行方法会直接调用所选模型。

<h2 id="read-one-model">
  读取单个模型
</h2>

当你已知模型 ID 时，直接获取目录条目：

```bash theme={null}
curl -H "X-API-Key: $COMFY_API_KEY" \
  https://api.comfy.org/v2/models/bfl/flux-2-pro
```

模型详情端点可以避免遍历整个目录。使用 [API 参考](/zh/development/comfy-router/reference) 查看完整的条目字段。

<h2 id="next">
  后续步骤
</h2>

* [Schema 与结果](/zh/development/comfy-router/schemas)：在调用模型之前，先阅读其输入和输出 schema。
* [全部模型](/zh/development/comfy-router/models)：浏览目录，每个模型都附带一个可用的请求。
