> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.butterix.com/llms.txt
> - v0: https://docs.butterix.com/v0/llms.txt

> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.butterix.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.butterix.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.butterix.com/_biti/feedback/agent.

# 列出可用模型

`GET /ai/models`

实时从提供商拉取模型列表（缓存 10 分钟）。传 `site` 时优先使用该站点的密钥，否则使用平台密钥。
无法拉取时返回内置列表，并设置 `live: false` 与 `error`。

Base URL: https://api.butterix.com/v1

Authentication: bearer token in Authorization header or API key in cookie `biti_session`

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. |
| `site` | string | no | 站点 slug 或 id |

## Example request

```bash
curl https://api.butterix.com/v1/ai/models \
     -H "Authorization: Bearer <token>"
```

## Responses

### 200

模型列表（推荐模型排在最前）

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `models` | list of objects | no |  |
| `models[].id` | string | no |  |
| `models[].label` | string | no |  |
| `models[].contextWindow` | integer | no |  |
| `models[].pricing` | object | no | 每百万 tokens 的美元价格（提供商报告时） |
| `models[].pricing.input` | number | no |  |
| `models[].pricing.output` | number | no |  |
| `models[].recommended` | boolean | no |  |
| `models[].reasoning` | object | no | 模型支持的推理强度；没有时不返回 |
| `models[].reasoning.efforts` | list of enums | no | 由低到高的档位，`none` 是关闭思考；为空表示会思考但没有档位可选 |
| `models[].reasoning.suggested` | string | no | 没有设置时使用的档位 |
| `models[].reasoning.default` | string | no | 模型自己的默认档位 |
| `live` | boolean | no |  |
| `error` | string | no |  |

### Example response (200)

```json
{
  "models": [
    {
      "id": "claude-opus-5-5",
      "label": "Claude Opus 5.5",
      "contextWindow": 1000000,
      "pricing": {
        "input": 4,
        "output": 20
      },
      "recommended": true,
      "reasoning": {
        "efforts": [
          "none"
        ],
        "suggested": "low",
        "default": "high"
      }
    }
  ],
  "live": true,
  "error": "string"
}
```
