> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# 将你的智能体连接到 AIsa

> 将 AIsa MCP 服务器添加到 Claude Code、Cursor、Codex 或其他智能体，通过浏览器 OAuth 登录并开始使用工具。仅在 MCP 无法运行时才使用 CLI。

**AI 智能体正在阅读？** 前往 [智能体指引](#智能体指引)，自行完成配置。

AIsa 提供远程 MCP 服务器，地址为 `https://mcp.aisa.one/mcp`。认证采用浏览器 OAuth，无需复制 API key。

**1. 添加服务器**

```bash Claude Code theme={null}
claude mcp add --transport http -s user aisa https://mcp.aisa.one/mcp
```

```bash Codex theme={null}
codex mcp add aisa --url https://mcp.aisa.one/mcp
```

```json Cursor (~/.cursor/mcp.json) theme={null}
{
  "mcpServers": {
    "aisa": { "url": "https://mcp.aisa.one/mcp" }
  }
}
```

```json VS Code (.vscode/mcp.json) theme={null}
{
  "servers": {
    "aisa": { "type": "http", "url": "https://mcp.aisa.one/mcp" }
  }
}
```

对于 Claude：添加自定义连接器，填入 `https://mcp.aisa.one/mcp`（[指南](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-claude.md)）。对于 ChatGPT：安装 AIsa GTM 插件（[指南](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-chatgpt.md)）。

**2. 登录**

你的 MCP 客户端会打开浏览器窗口；点击 **Allow** 完成 OAuth。在 Claude Code 中运行 `/mcp`，选择 **aisa** 并认证。在 Cursor 中，打开 **Customize** → **MCPs**，在 **aisa** 上点击 **Authenticate**。

**3. 向你的智能体提问**

将以下内容粘贴到智能体对话中：

```txt wrap theme={null}
使用 AIsa 检查我的账户，然后找到你选择的一家公司的三条最新公开动态，附上来源链接。在任何付费调用前先征得我的同意。
```

想让智能体也帮你完成配置？粘贴 `Set up AIsa using https://aisa.one/docs/zh/agent-quickstart.md.`，它会按照下方的指引操作。

## 智能体指引

配置 AIsa。对应的命令由你自己运行，不要让用户去跑——除非沙箱或被拒绝的写入挡住了你：那时转述确切步骤并等待。

复用现有连接：一个已授权的 AIsa MCP 服务器（`https://mcp.aisa.one/mcp`），其工具列表中包含 `search` 和 `batch_quote`；或一个官方 `aisa` Skill 加上有效的 CLI 认证。用户的明确选择或仍处于授权状态的连接优先；不要自动迁移或重新安装。不要更改无关的模型设置。按此智能体环境的实际情况描述安装和凭据。

默认使用原生远程 MCP `https://mcp.aisa.one/mcp`（Streamable HTTP、OAuth），只要此客户端能添加该连接器——无论是用户本地还是云端、有无终端。有可用的 shell 不构成选择 CLI 的理由。

仅在此客户端完全没有 MCP 机制，或用户明确选择时，才使用 CLI。没有浏览器的客户端（CI、SSH、容器）仍使用 MCP，只是用 API key 代替 OAuth。这些限制条件及 [使用 CLI](https://aisa.one/docs/zh/get-started/cli.md) 中的 Node 规则优先于任何已安装的 `aisa` Skill；Skill 仅用于后续操作。

### MCP（默认）

连接 `https://mcp.aisa.one/mcp`（Streamable HTTP、OAuth）。不需要 CLI、npm、npx 或 Skill 安装；可使用已安装的指引。客户端负责浏览器登录和 token。使用此客户端自身的 MCP 机制，而非手动编辑其他工具的配置文件：

* Claude Code：`claude mcp add --transport http -s user aisa https://mcp.aisa.one/mcp`
* Codex：`codex mcp add aisa --url https://mcp.aisa.one/mcp`（Codex 会自行启动 OAuth）
* Cursor / VS Code：在 MCP 配置中为 `https://mcp.aisa.one/mcp` 添加 `url` 条目

如果此客户端无法打开浏览器（CI、SSH、容器），发送 `Authorization: Bearer $AISA_API_KEY` 代替 OAuth（Claude Code：`--header "Authorization: Bearer $AISA_API_KEY"`；Codex：`--bearer-token-env-var AISA_API_KEY`）。如果未设置 `AISA_API_KEY`，请用户在 [console.aisa.one/api-keys](https://console.aisa.one/api-keys) 创建 key 并设置到环境中；绝不要让用户把 key 粘贴到对话里。绝不打印、记录或提交 key。

添加连接器后，让用户在浏览器中完成 OAuth（当客户端发送 `AISA_API_KEY` 时跳过此步）。如果此客户端支持 MCP 但你无法在这里添加连接器——能力未知、沙箱或权限被拒——不要切换到 CLI：要求用户启用或添加连接器，然后等待。如果客户端必须重新加载或启动新会话才能加载连接器，告知用户；之后验证工具，期间不要切换到 CLI。

Grok Bot + Plugins：Settings → Plugins → Add → 如有要求则认证 → `@` 附加。如果存在原生自定义 MCP 设置，输入该 URL 并完成 OAuth。如果两者都不可用，要求用户启用或添加连接器。grok.com（`grok.com/connectors`）是不同的产品。

然后使用这些工具：`search`（描述任务；复用其 `session_id`）→ 当结果缺少完整 schema 时用 `get_details`（也以 `batch_get_schema` 提供）→ 用确切的调用执行 `batch_quote` → 用相同的调用执行 `batch_use`，每批最多 20 个。`search`、`list_categories`、`get_details` 和 `batch_quote` 免费；`batch_use` 按调用计费。`use` 是较早的单次调用形式，为现有客户端保留；这里只在下方免费的 `account` 检查中用到。工具名称和参数从 `search` 或 `get_details` 获取；不要自行编造名称或价格。消费审批和错误处理（`401`、`402`、`429`）遵循 [智能体配置指南](https://aisa.one/llms.txt) 第 4、5 节。

### CLI（仅当 MCP 在此无法运行时）

遵循 [使用 CLI](https://aisa.one/docs/zh/get-started/cli.md)：其限制条件、Node.js 规则、Skill 安装和登录。不要绕过缺失的前置条件或被拒绝的写入。

### 完成

只有在认证有效（OAuth，或把现有 `AISA_API_KEY` 作为 Bearer token 发送），并且一次免费的受保护调用成功之后——MCP 调用 `use`、`operation_id` 为 `account`（返回 key、余额和用量），或 CLI 的 `aisa balance`——才报告 \*\*AIsa is connected.\*\*工具元数据或 `401` 不算受保护调用。连接器缺失不算已连接。然后继续指定的任务，或询问 **What would you like to do first?** CLI 遵循 `aisa` Skill；MCP 使用那些工具。配置不等于消费批准。

不要为了绕过缺失的凭据、用尽的余额或同一个 API 故障而改走 HTTP。不要用付费调用来测试可用性。不要提取客户端拥有的 MCP OAuth token。

仅当 CLI 和 MCP 都不可用、HTTP 可用且已有有效 AIsa key 时：在付费提案、费用批准或付费请求之前，阅读 [使用 CLI](https://aisa.one/docs/zh/get-started/cli.md#直接-http-回退) 的直接 HTTP 部分（端点文档、定价、批准 XML）。更多模型、REST、key 或 Skill：[AIsa 文档](https://aisa.one/docs/zh)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.