> 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 /_biti/ai/token`

领取调用 [Ask AI 对话](https://docs.butterix.com/api-reference/runtime/ask-ai.md) 所需的会话令牌，30 分钟有效，绑定站点、客户端网段与浏览器标识（换了网络或浏览器需要重新领取）。
跨站请求返回 403；每个 IP 每分钟最多 30 次。

Base URL: https://butterix-sites.butterix.com

## Example request

```bash
curl https://butterix-sites.butterix.com/_biti/ai/token
```

## Responses

### 200

会话令牌

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `token` | string | yes |  |
| `expiresAt` | integer | yes | 过期时间（毫秒时间戳） |

### 403

跨站请求

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | string | yes | 人类可读的错误信息 |
| `code` | string | no | 机器可读的错误码（部分接口提供） |

### 429

请求过于频繁

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | string | yes | 人类可读的错误信息 |
| `code` | string | no | 机器可读的错误码（部分接口提供） |

### Example response (200)

```json
{
  "token": "1795435200000.Zm9vYmFyYmF6cXV4cXV1eGNvcmdl",
  "expiresAt": 1
}
```
