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

> ## Agent Instructions
> JieKou AI model APIs are OpenAI-compatible. Base URL for users in mainland China (direct, no VPN): https://api.highwayapi.ai/openai; elsewhere: https://api.jiekou.ai/openai. Anthropic-compatible base URL: https://api.highwayapi.ai/anthropic or https://api.jiekou.ai/anthropic.
> Authenticate with `Authorization: Bearer <API_KEY>`; with Anthropic SDKs or Claude Code, pass the same key as `ANTHROPIC_AUTH_TOKEN`. Users create keys at https://jiekou.ai/settings/key-management. Never print or hardcode a real key.
> Get current model IDs from GET https://api.jiekou.ai/openai/v1/models instead of reusing model names from memory.

# Pi

## 什么是Pi？

Pi 是一个极简、可自我改造的终端 AI 编程 Agent，最初由 Mario Zechner（badlogic）创建，现由 Earendil Works 维护，官方口号是“让 Pi 适应你的工作流，而不是反过来”。给它一个目标和一个工作目录，它就能读文件、执行命令、改代码、推进多步任务；默认内核刻意保持最小，不内置 sub-agent、plan mode、权限弹窗和后台 bash，而是把这些能力交给 TypeScript 扩展、Skills、Prompt 模板和主题实现。

Pi 支持 15 家以上模型提供商和数百个模型，会话中可以随时切换；会话以树结构存储，能用 `/tree`、`/fork`、`/clone` 回到任意历史节点另开分支，并支持导出 HTML 或生成分享链接。它的上下文工程是核心卖点：极简 system prompt、AGENTS.md 项目指令、可定制的自动压缩和按需加载的 Skills；运行时支持交互式 TUI、print/JSON 脚本模式、RPC 和 TypeScript SDK。项目采用 MIT 许可，但官方明确不内置权限系统，默认以启动用户的权限运行，建议放在容器或沙箱中使用。

官网：[https://pi.dev/](https://pi.dev/)

Github：[https://github.com/earendil-works/pi](https://github.com/earendil-works/pi)

使用接口AI提供的API服务，可以在Pi中调用全球前沿大模型，无缝对接您在Pi中的工作流。

## 如何将接口AI接入Pi？

### 获取 API Key

1. 登录官网 jiekou.ai 注册。

2. 进入管理后台，点击右上方“我的”，在下拉列表中选择“API 密钥管理”。

   ![](https://mintcdn.com/jiekou/woskTYHkYOH0CRpH/images/pi-01.png?fit=max\&auto=format\&n=woskTYHkYOH0CRpH\&q=85\&s=76cb5c9c851a0f8b9c947169fbce3eee)

3. 点击“创建”，输入密钥名称。建议填写便于识别的名称，方便后续在控制台区分不同用途的密钥。

   ![](https://mintcdn.com/jiekou/woskTYHkYOH0CRpH/images/pi-02.png?fit=max\&auto=format\&n=woskTYHkYOH0CRpH\&q=85\&s=5cd1d23cad28bb10d53902bcc0be70d0)

4. 点击复制并记录生成的 Key。控制台不可再次查看，请妥善保存Key以便后续使用。

### 将接口AI接入Pi

创建`.pi\agent\models.json`，格式如下，填入相应信息即可：

```json theme={null}
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "highway": {
      "name": "Jiekou",
      "baseUrl": "https://api.highwayapi.ai/openai/v1",
      "api": "openai-completions",
      "apiKey": "你的API Key",
      "models": [
        {
          "id": "claude-opus-5-5",
          "name": "Claude Opus 5.5",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 128000,
          "cost": { "input": 4, "output": 20, "cacheRead": 0.2, "cacheWrite": 5 }
        }
      ]
    }
  }
}
```


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