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

# 在 Grok Build 中使用 AIsa

> 几行配置，把 AIsa 添加为 xAI Grok Build CLI 的远程 MCP server。

Grok Build（`grok` CLI）原生支持远程 MCP server。把 AIsa 加入 `~/.grok/config.toml`，Grok 就能发现并调用 AIsa 能力——网页研究、金融、社交、SEO、销售等。

AIsa MCP endpoint：

```txt theme={null}
https://mcp.aisa.one/mcp
```

## 前置条件

开始前，请确认你已经具备：

* AIsa API key（[console.aisa.one/api-keys](https://console.aisa.one/api-keys)）
* macOS、Linux 或 Windows 上的 terminal

## 1. 安装 Grok Build

```bash theme={null}
# macOS / Linux / Git Bash
curl -fsSL https://x.ai/cli/install.sh | bash

# Windows (PowerShell)
irm https://x.ai/cli/install.ps1 | iex
```

验证安装：

```bash theme={null}
grok --version
```

## 2. 导出 AIsa key

Grok 从环境变量读取 key，不会写进配置文件。把这一行加入 `~/.zshrc` 或 `~/.bashrc`：

```bash theme={null}
export AISA_API_KEY="sk-aisa-..."
```

启动 Grok 前，打开新的 terminal 或 `source` 该文件。

## 3. 让 Grok 连接 AIsa

启动 `grok` 并发送：

```txt theme={null}
Read https://aisa.one/llms.txt and help me connect to AIsa.
```

Grok 会读取 AIsa 面向智能体的说明，并把 AIsa MCP server 添加到 `~/.grok/config.toml`。

> [!TIP]
>
> 想自己动手？把这段加入 `~/.grok/config.toml`：
>
> ```toml theme={null}
> [mcp_servers.aisa]
> url = "https://mcp.aisa.one/mcp"
> enabled = true
> bearer_token_env_var = "AISA_API_KEY"
> ```

## 4. 验证连接

```bash theme={null}
grok mcp doctor aisa
```

应当看到：

```txt theme={null}
aisa (http: https://mcp.aisa.one/mcp)
  ✓ server started
  ✓ handshake OK
  ✓ 7 tools discovered
```

如果是在 Grok 运行时修改的配置，输入 `/mcps` 并按 `r` 刷新 server 列表。

## 5. 使用 AIsa 能力

让 Grok 获取任何 AIsa 能提供的数据，例如：

```txt theme={null}
Use AIsa to check the recent posts of Sam Altman. Ask me before any paid call.
```

Grok 会搜索 AIsa 目录、读取匹配操作的 schema，先用 `batch_quote` 为确切调用报价，再用 `batch_use` 执行。发现与报价工具（`list_categories`、`search`、`get_details`、`batch_quote`）免费；`batch_use` 按次计费。

## 快速参考

| 项目 | 值 |
| - | - |
| 配置文件 | `~/.grok/config.toml`（或项目内的 `.grok/config.toml`） |
| 配置段 | `[mcp_servers.aisa]` |
| `url` | `https://mcp.aisa.one/mcp` |
| 认证 | `bearer_token_env_var = "AISA_API_KEY"` |
| 验证 | `grok mcp doctor aisa` |
| 在运行中的会话里刷新 | `/mcps` → `r` |

## 故障排查

| 问题 | 解决方法 |
| - | - |
| `grok mcp doctor aisa` 报 401 | 在启动 Grok 的 shell 中确认 `echo $AISA_API_KEY` 能打印出 key，并在[控制台](https://console.aisa.one)确认 key 有效 |
| server 显示 `folder untrusted` | 项目级 server 需要受信任的目录——把配置移到 `~/.grok/config.toml`，或在 Grok 询问时信任该目录 |
| 出现了另一个 `aisa` server | Grok 也会加载 `.mcp.json` 以及 Claude / Cursor 的 MCP 配置；Grok 自己配置里的 `[mcp_servers.aisa]` 优先 |
| 当前会话里没有 AIsa 工具 | 输入 `/mcps` 并按 `r`，或开启新的 Grok 会话 |

## 相关页面

> [card] [在 Pi 中使用 AIsa](https://aisa.one/docs/zh/guides/tutorials/use-aisa-in-pi.md)
>
> 在 Pi 编程智能体中完成同样的 MCP 设置。

> [card] [认证](https://aisa.one/docs/zh/guides/authentication.md)
>
> API key 创建、轮换和存储最佳实践。

> [card] [Agent Skills](https://aisa.one/docs/zh/agent-skills.md)
>
> 浏览 AIsa 向智能体开放的能力。


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