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

# Magpie

## 什么是Magpie？

magpie 让每个 Agent 都能用上每一个模型。供应商只需添加一次——DeepSeek、Kimi、GLM、Qwen、OpenRouter、Ollama，或你已经在付费的 Claude 和 ChatGPT 订阅——然后在 Codex、Claude Code、Gemini CLI 或任何 Agent 里一键选用。

每个 Agent 都把模型写在自己的配置文件里，格式各不相同，key 和 base URL 各管各的。花钱买的订阅只能在一个 Agent 里用。magpie 把这些收进一个应用和一个本地网关：

* 任意 Agent 用任意模型，在一张表里选。magpie 只改 Agent 配置里该改的那一个键。
* 一个 provider 处处能用：API key、本地模型，或者你登录着的 Claude、ChatGPT、Copilot、Gemini、Grok 订阅。
* 额度用完也不断：同一个服务商的下一个账号自动接上，路由组还能换到别的模型或服务商，Agent 看不到报错。只有一个账号又没建路由组时，没有可换的，报错会原样回给 Agent。
* 密钥不出你的电脑：在 设置 → 隐私 打开脱敏后（默认关闭），提示词里的密钥、密码、邮箱，在请求离开电脑前就在本地脱敏，回复里再换回原值。
  如果你用不止一个 Agent、不止一个 provider 或不止一个账号，它就适合你。如果你只用一个 Agent、只用它自家的订阅，而且够用，那就不需要 magpie。

支持 macOS、Windows 和 Linux（菜单栏应用、窗口、TUI、Web 界面和 CLI），也能跑在 Docker 和 Termux 上。

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

### 获取 API Key

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

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

   ![](https://mintcdn.com/jiekou/f-T_E3hNj8sGYUsR/images/magpie-01.png?fit=max\&auto=format\&n=f-T_E3hNj8sGYUsR\&q=85\&s=c123fc8d8326ed7b03e6275713012eb5)

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

   ![](https://mintcdn.com/jiekou/f-T_E3hNj8sGYUsR/images/magpie-02.png?fit=max\&auto=format\&n=f-T_E3hNj8sGYUsR\&q=85\&s=6e87360fa491250e85699d119031cbf4)

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

### 将接口AI接入Magpie

1. 在供应商中添加自定义供应商

   ![](https://mintcdn.com/jiekou/eY20tqhq6niA3Adp/images/magpie-03.png?fit=max\&auto=format\&n=eY20tqhq6niA3Adp\&q=85\&s=fb3087b909f1f06080f6ca4813ab44ef)

2. 填入刚刚复制的API Key，填入URL，选择你想要调用的模型适用的API格式（API Endpoint）

* 国内直连URL：[https://api.highwayapi.ai/openai](https://api.highwayapi.ai/openai)
* 海外URL：[https://api.jiekou.ai/openai](https://api.jiekou.ai/openai)

  ![](https://mintcdn.com/jiekou/eY20tqhq6niA3Adp/images/magpie-04.png?fit=max\&auto=format\&n=eY20tqhq6niA3Adp\&q=85\&s=8ffe91b383d1f6b8e217d0c306c53806)

3. 输入模型ID或点击“获取模型”查看模型列表，点击“添加”即可接入


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