> 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.

# 获取 Ask AI 设置

`GET /sites/{site}/ai`

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

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `site` | string | yes | 站点 slug 或 id |

## Example request

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

## Responses

### 200

当前设置（密钥只返回掩码）

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `enabled` | boolean | no |  |
| `provider` | enum | no | Allowed: `anthropic`, `deepseek`, `openrouter`. |
| `model` | string | no |  |
| `hasKey` | boolean | no | 是否设置了站点密钥 |
| `keyMasked` | string | no |  |
| `platformKeyAvailable` | boolean | no | 平台是否为当前提供商配置了默认密钥 |
| `platformKeys` | map from strings to booleans | no | 每个提供商是否有平台密钥 |
| `guidance` | string | no |  |
| `effort` | enum | no | 推理强度；`null` 表示使用模型的建议档位 May be null. Allowed: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`. |
| `retentionDays` | integer | no | 提问记录保留天数；`null` 表示一直保留 May be null. |
| `dailyLimit` | integer | no | 滚动 24 小时内调用模型的提问上限；`null` 表示不限 May be null. |
| `agent` | boolean | no | 控制台 AI 是否启用 |
| `gaps` | boolean | no | 是否每天自动整理文档缺口 |
| `support` | object | no | 答不上时转人工 |
| `support.enabled` | boolean | no |  |
| `support.url` | string | no |  |
| `support.email` | string | no |  |

### Example response (200)

```json
{
  "enabled": true,
  "provider": "anthropic",
  "model": "claude-opus-5-5",
  "hasKey": true,
  "keyMasked": "sk-a…9f2c",
  "platformKeyAvailable": true,
  "platformKeys": {
    "key": true
  },
  "guidance": "string",
  "effort": "none",
  "retentionDays": 1,
  "dailyLimit": 200,
  "agent": true,
  "gaps": false,
  "support": {
    "enabled": false,
    "url": "",
    "email": ""
  }
}
```
