# 查询公开模型目录

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

查询已启用且公开可见模型的能力和报价。

```text
GET https://billing.moi.matrixorigin.cn/api/v1/taas/public/models
```

## 调用前准备

无需认证。

## 查询参数

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} 输入示例

```bash
curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/public/models" \
  --data-urlencode "page_size=2"
```

将响应中的 `next_page_token` 保存为 `$NEXT_PAGE_TOKEN`，保持筛选条件不变并请求下一页。该值为空或省略时停止翻页。

```bash
curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/public/models" \
  --data-urlencode "page_size=2" \
  --data-urlencode "page_token=$NEXT_PAGE_TOKEN"
```

:::::
:::::{tab-item} 参数说明

::::{div} mo-api-parameter-table

| 参数 | 类型 | 是否必填 | 说明 |
| --- | --- | --- | --- |
| `type` | string | 否 | 模型类型筛选。 |
| `page_size` | integer | 否 | 每页数量，默认 100，最大 1000。 |
| `page_token` | string | 否 | 上一页返回的下一页标记；首个请求省略。 |

::::

:::::
::::::
:::::::

## 成功响应

返回 HTTP `200`，响应包含公开模型目录及报价。

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} 响应示例

```json
{
  "items": [
    {
      "id": "model_example",
      "name": "example-chat-model",
      "alias": "Example Chat",
      "logo": "example",
      "description": "Example chat model.",
      "type": "chat",
      "capabilities": [
        "chat"
      ],
      "context_window": 32768,
      "input_price_per_million": "0",
      "output_price_per_million": "0",
      "cache_creation_price_per_million": "0",
      "cache_hit_price_per_million": "0",
      "ocr_price_per_page": "0",
      "image_price_per_image": "0",
      "image_hd_price_per_image": "0",
      "video_price_per_second": "0",
      "video_hd_price_per_second": "0",
      "tts_price_per_10k_chars": "0",
      "tts_hd_price_per_10k_chars": "0",
      "asr_price_per_minute": "0",
      "asr_realtime_price_per_minute": "0",
      "currency": "CNY"
    }
  ],
  "total": 1,
  "next_page_token": ""
}
```

:::::
:::::{tab-item} 字段说明

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `items` | array of object | 本页记录。 |
| `items[].id` | string | 模型目录对象 ID，用于模型健康状态等管理查询。 |
| `items[].name` | string | 模型调用名称。 |
| `items[].alias` | string | 模型显示别名；未设置时省略。 |
| `items[].logo` | string | 模型系列标识；未设置时省略。 |
| `items[].description` | string | 模型说明；未设置时省略。 |
| `items[].type` | string | 模型类型。 |
| `items[].capabilities` | array of string | 模型支持的调用能力；未设置时省略。 |
| `items[].context_window` | integer | 上下文窗口 Token 数；未设置时省略。 |
| `items[].input_price_per_million` | string | 每百万输入 Token 的价格。 未设置时可省略。 |
| `items[].output_price_per_million` | string | 每百万输出 Token 的价格。 未设置时可省略。 |
| `items[].cache_creation_price_per_million` | string | 每百万缓存写入 Token 的价格。 未设置时可省略。 |
| `items[].cache_hit_price_per_million` | string | 每百万缓存读取 Token 的价格。 未设置时可省略。 |
| `items[].ocr_price_per_page` | string | 每页 OCR 的价格。 未设置时可省略。 |
| `items[].image_price_per_image` | string | 每张图片的价格。 未设置时可省略。 |
| `items[].image_hd_price_per_image` | string | 每张高清图片的价格。 未设置时可省略。 |
| `items[].video_price_per_second` | string | 每秒视频的价格。 未设置时可省略。 |
| `items[].video_hd_price_per_second` | string | 每秒高清视频的价格。 未设置时可省略。 |
| `items[].tts_price_per_10k_chars` | string | 每万字符语音合成价格。 未设置时可省略。 |
| `items[].tts_hd_price_per_10k_chars` | string | 每万字符高清语音合成价格。 未设置时可省略。 |
| `items[].asr_price_per_minute` | string | 每分钟语音识别价格。 未设置时可省略。 |
| `items[].asr_realtime_price_per_minute` | string | 每分钟实时语音识别价格。 未设置时可省略。 |
| `items[].currency` | string | 模型报价使用的货币。 |
| `total` | integer | 符合筛选条件的总记录数。 |
| `next_page_token` | string | 下一页标记；为空或省略时已到最后一页。 |

字段路径中的 `[]` 表示数组中的每一项。

:::::
::::::
:::::::
