---
title: "列出模型的上游"
description: "列出提供某个模型的上游，每个云平台一条。"
canonical: "https://pirouter.ai/zh/docs/api/list-model-endpoints"
last-updated: "2026-10-13"
lang: "zh"
---

# 列出模型的上游

列出提供某个模型的上游，每个云平台一条。

`GET https://api.pirouter.ai/v1/models/{vendor}/{model}/endpoints`

目录里某个模型的上游视图。一个平台只要有一个部署满足 `contracts.Serves` 的条件，就算提供该模型。条件是模型、部署和资源均已启用，且上游 key 已封存。这也是路由的候选集合。站点目录的 `pi.providers` 和路由页面的 provider 列表用的是同一条规则，所以三处列出的平台一致；健康状态不在这条规则之内。每个平台只有一条，内容取自它最优的那个部署：非 `down` 的排在 `down` 之前，其次权重高者优先，仍相同时按 id 决定。各条按该部署的权重从高到低排序，权重相同时按平台 id 排序。

只输出可以公开的信息：协议与端点、token 上限、渠道的基础价格、实际生效的能力，以及上游的数据策略。区域、账号、资源和部署名称不会出现，这里的每个对象都是封闭的。

模型不存在或不可列出时，返回与 `GET /v1/models/{vendor}/{model}` 相同的 `404 model_not_found`。模型可列出、但此刻没有任何平台能提供时，返回 `200`，`endpoints` 列表为空。

公开端点：不需要 API key，带了也不会读取。

## 鉴权

这个端点是公开的：不需要 API key，传了也不会读取。

## 路径参数

| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `vendor` | string | 是 | 模型 ID 斜杠左边的部分，精确匹配。 |
| `model` | string | 是 | 模型 ID 斜杠右边的部分，精确匹配。 |

## 响应

`200` `application/json`

该模型的上游视图。

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `data` | object | 是 | 单个模型的上游视图。 |
| `data.id` | string | 是 | 模型 ID，与目录里的一致。 |
| `data.aliases` | string[] | 是 | `model` 字段里还接受的该模型的其他名字，已排序。 |
| `data.openness` | string | 是 | 模型的开放程度（契约词表 `openness_levels`）：open_source、open_weights 或 proprietary。 |
| `data.model_page_url` | string \| null | 是 | 模型的页面，具体含义由 `openness` 决定：源码仓库、权重页面或厂商的模型页面。原样透传；未记录时为 null。 |
| `data.capabilities` | string[] | 是 | 模型的能力（契约词表 `model_capabilities` 里的 ID，形如 `supports_*`），按词表顺序排列；只列出模型具备的能力。 |
| `data.protocols` | string[] | 是 | 至少有一条上游接受的入站协议（契约词表 `protocols` 里的 ID），按词表顺序排列。 |
| `data.supported_endpoints` | string[] | 是 | 至少有一条上游提供的 API 端点（契约词表 `endpoints` 里的 ID），按词表顺序排列。 |
| `data.endpoints` | object[] | 是 | 能提供该模型的云平台，每个平台一条；此刻没有平台能提供时为空。 |
| `data.endpoints[].provider` | string | 是 | 云平台 ID（契约词表 `platforms`）。站点把它映射成显示名称。 |
| `data.endpoints[].provider_type` | string | 是 | 供给关系（契约词表 `resource_types`）：first_party、cloud_infra、reseller 或 private。 |
| `data.endpoints[].headquarters` | string \| null | 是 | 上游运营方的总部所在地，ISO 3166-1 alpha-2 代码；未声明时为 null。 |
| `data.endpoints[].protocols` | string[] | 是 | 该平台为这个模型接受的入站协议（契约词表 `protocols` 里的 ID）。 |
| `data.endpoints[].supported_endpoints` | string[] | 是 | 该平台为这个模型提供的 API 端点（契约词表 `endpoints` 里的 ID）。 |
| `data.endpoints[].context_length` | integer \| null | 是 | 该平台上的上下文窗口，以 token 计；未声明时为 null。 |
| `data.endpoints[].max_prompt_tokens` | integer \| null | 是 | 该平台上的提示词 token 上限；未声明时为 null。 |
| `data.endpoints[].max_completion_tokens` | integer \| null | 是 | 该平台上的补全 token 上限；未声明时为 null。 |
| `data.endpoints[].quantization` | string \| null | 是 | 该平台运行的精度（契约词表 `quantizations`）；未声明时为 null。 |
| `data.endpoints[].supports_stream_cancellation` | boolean | 是 | 在该平台上，中止流是否会停止计费。 |
| `data.endpoints[].capabilities` | string[] | 是 | 该平台上实际生效的能力，即模型的能力经渠道收窄后的结果（契约词表 `model_capabilities` 里的 ID），按词表顺序排列。 |
| `data.endpoints[].pricing` | object | 是 | 该渠道当前的生效价格，也就是路由到这里的请求的计费价格。`overrides` 下的上下文分档同样是该渠道的生效价格。 |
| `data.endpoints[].pricing.prompt` | string | 是 | 输入文本，按每 token 计，美元。始终存在；模型没有输入文本价格时为 "0"（例如图像或音频模型）。 |
| `data.endpoints[].pricing.completion` | string | 是 | 输出文本，按每 token 计，美元。始终存在；模型没有输出文本价格时为 "0"（例如 embedding 模型）。 |
| `data.endpoints[].pricing.request` | string | 否 | 每次请求的固定费用，美元。 |
| `data.endpoints[].pricing.image` | string | 否 | 输入图像，按每张图像计，美元。 |
| `data.endpoints[].pricing.image_output` | string | 否 | 输出图像，按每 token 计，美元。 |
| `data.endpoints[].pricing.audio` | string | 否 | 输入音频，按每 token 计，美元。 |
| `data.endpoints[].pricing.audio_output` | string | 否 | 输出音频，按每 token 计，美元。 |
| `data.endpoints[].pricing.input_audio_cache` | string | 否 | 从缓存读取的输入音频，按每 token 计，美元。 |
| `data.endpoints[].pricing.web_search` | string | 否 | 内置网页搜索，按每次调用计，美元。 |
| `data.endpoints[].pricing.internal_reasoning` | string | 否 | 推理输出 token，按每 token 计，美元。 |
| `data.endpoints[].pricing.input_cache_read` | string | 否 | 从缓存读取的输入文本，按每 token 计，美元。 |
| `data.endpoints[].pricing.input_cache_write` | string | 否 | 写入缓存的输入文本，按每 token 计，美元（厂商默认的缓存 TTL）。 |
| `data.endpoints[].pricing.input_cache_write_1h` | string | 否 | 按 1 小时 TTL 写入缓存的输入文本，按每 token 计，美元；仅在厂商对这一档单独定价时出现。 |
| `data.endpoints[].pricing.image_token` | string | 否 | 输入图像，按每 token 计，美元。这是按 token 计价的一档，区别于按整张图像计价的 `image`。 |
| `data.endpoints[].pricing.overrides` | object[] | 否 | 基础档之上的上下文分档，按 min_prompt_tokens 升序排列（min_prompt_tokens 是提示词上下文长度的下限，以 token 计，含边界值）。在 min_prompt_tokens 不超过请求提示词上下文长度的各档中，请求按 min_prompt_tokens 最大的一档计费；上面的基础价格覆盖第一档以下的所有情况。模型只有单一价格时不出现。每一档只列出它自己声明的类别。各档之间是替换关系，不做合并。所以某一档里缺少某个类别，表示这一档没有重新声明它，不表示这一档把它定价为零。 |
| `data.endpoints[].pricing.overrides[].min_prompt_tokens` | integer | 是 | 这一档开始生效的提示词上下文长度下限（以 token 计），含边界值。 |
| `data.endpoints[].pricing.overrides[].prompt` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].completion` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].request` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].image` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].image_output` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].audio` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].audio_output` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].input_audio_cache` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].web_search` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].internal_reasoning` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].input_cache_read` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].input_cache_write` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].input_cache_write_1h` | string | 否 |  |
| `data.endpoints[].pricing.overrides[].image_token` | string | 否 |  |
| `data.endpoints[].list_pricing` | object | 是 | 模型的原价，与目录里 Model 的 `pricing` 是同一个对象。没有折扣或渠道价格时，与 `pricing` 相同。 |
| `data.endpoints[].list_pricing.prompt` | string | 是 | 输入文本，按每 token 计，美元。始终存在；模型没有输入文本价格时为 "0"（例如图像或音频模型）。 |
| `data.endpoints[].list_pricing.completion` | string | 是 | 输出文本，按每 token 计，美元。始终存在；模型没有输出文本价格时为 "0"（例如 embedding 模型）。 |
| `data.endpoints[].list_pricing.request` | string | 否 | 每次请求的固定费用，美元。 |
| `data.endpoints[].list_pricing.image` | string | 否 | 输入图像，按每张图像计，美元。 |
| `data.endpoints[].list_pricing.image_output` | string | 否 | 输出图像，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.audio` | string | 否 | 输入音频，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.audio_output` | string | 否 | 输出音频，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.input_audio_cache` | string | 否 | 从缓存读取的输入音频，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.web_search` | string | 否 | 内置网页搜索，按每次调用计，美元。 |
| `data.endpoints[].list_pricing.internal_reasoning` | string | 否 | 推理输出 token，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.input_cache_read` | string | 否 | 从缓存读取的输入文本，按每 token 计，美元。 |
| `data.endpoints[].list_pricing.input_cache_write` | string | 否 | 写入缓存的输入文本，按每 token 计，美元（厂商默认的缓存 TTL）。 |
| `data.endpoints[].list_pricing.input_cache_write_1h` | string | 否 | 按 1 小时 TTL 写入缓存的输入文本，按每 token 计，美元；仅在厂商对这一档单独定价时出现。 |
| `data.endpoints[].list_pricing.image_token` | string | 否 | 输入图像，按每 token 计，美元。这是按 token 计价的一档，区别于按整张图像计价的 `image`。 |
| `data.endpoints[].list_pricing.overrides` | object[] | 否 | 基础档之上的上下文分档，按 min_prompt_tokens 升序排列（min_prompt_tokens 是提示词上下文长度的下限，以 token 计，含边界值）。在 min_prompt_tokens 不超过请求提示词上下文长度的各档中，请求按 min_prompt_tokens 最大的一档计费；上面的基础价格覆盖第一档以下的所有情况。模型只有单一价格时不出现。每一档只列出它自己声明的类别。各档之间是替换关系，不做合并。所以某一档里缺少某个类别，表示这一档没有重新声明它，不表示这一档把它定价为零。 |
| `data.endpoints[].list_pricing.overrides[].min_prompt_tokens` | integer | 是 | 这一档开始生效的提示词上下文长度下限（以 token 计），含边界值。 |
| `data.endpoints[].list_pricing.overrides[].prompt` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].completion` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].request` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].image` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].image_output` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].audio` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].audio_output` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].input_audio_cache` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].web_search` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].internal_reasoning` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].input_cache_read` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].input_cache_write` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].input_cache_write_1h` | string | 否 |  |
| `data.endpoints[].list_pricing.overrides[].image_token` | string | 否 |  |
| `data.endpoints[].discount` | object \| null | 是 | 该渠道上计费所用的那一档价格是低于原价的折扣价时，此字段不为 null。 |
| `data.endpoints[].discount.percent_off` | integer | 是 | 相对该渠道原价的折扣百分比，取整，计算方式与 CatalogDiscount 相同。 |
| `data.endpoints[].discount.ends_at` | string \| null | 是 | 折扣结束时间，UTC，不含该时刻；没有结束时间时为 null。 |
| `data.endpoints[].data_policy` | object | 是 | 上游的数据策略，以平台登记的内容为准。 |
| `data.endpoints[].data_policy.prompt_training` | boolean \| null | 是 | 上游是否用提示词训练模型；null 表示未知。 |
| `data.endpoints[].data_policy.data_retention` | string | 是 | 契约词表 `data_retention_levels` 里的 ID；未记录时为 `unknown`。 |
| `data.endpoints[].data_policy.moderation` | string | 是 | 由谁负责内容审核（契约词表 `moderation_responsibilities`）。 |
| `data.endpoints[].data_policy.reviewed` | boolean | 是 | 运营人员对照上游公布的条款核对过这些字段后，为 true。 |

## 错误

| 状态码 | 错误码 | 说明 |
| --- | --- | --- |
| `404` | `model_not_found` | 没有这个可列出的模型（`model_not_found`）。 |
| `default` | `internal_error` | 平台侧的意外故障（`internal_error`）。 |

错误体

```json
{
  "error": {
    "code": "model_not_found",
    "message": "string"
  }
}
```

## 请求示例

cURL

```bash
curl https://api.pirouter.ai/v1/models/anthropic/claude-sonnet-5.5/endpoints
```

Python

```python
import requests

response = requests.get("https://api.pirouter.ai/v1/models/anthropic/claude-sonnet-5.5/endpoints")
print(response.json())
```

TypeScript

```ts
const response = await fetch('https://api.pirouter.ai/v1/models/anthropic/claude-sonnet-5.5/endpoints')
console.log(await response.json())
```

## 响应示例

`200` `application/json`

```json
{
  "data": {
    "id": "anthropic/claude-opus-5.5",
    "aliases": [
      "string"
    ],
    "openness": "open_weights",
    "model_page_url": null,
    "capabilities": [
      "string"
    ],
    "protocols": [
      "string"
    ],
    "supported_endpoints": [
      "string"
    ],
    "endpoints": [
      {
        "provider": "azure",
        "provider_type": "string",
        "headquarters": "US",
        "protocols": [
          "string"
        ],
        "supported_endpoints": [
          "string"
        ],
        "context_length": null,
        "max_prompt_tokens": null,
        "max_completion_tokens": null,
        "quantization": null,
        "supports_stream_cancellation": false,
        "capabilities": [
          "string"
        ],
        "pricing": {
          "prompt": "0.000003",
          "completion": "0.000015"
        },
        "list_pricing": {
          "prompt": "0.000003",
          "completion": "0.000015"
        },
        "discount": {
          "percent_off": 30,
          "ends_at": "2026-10-31T15:59:59Z"
        },
        "data_policy": {
          "prompt_training": null,
          "data_retention": "string",
          "moderation": "string",
          "reviewed": false
        }
      }
    ]
  }
}
```
