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

# Claude Desktop 安装与配置

> 在 Claude Desktop 中填入 RayinAPI 的请求地址和 API Key，无需登录 Anthropic 账号

Claude Desktop 是 Anthropic 官方桌面应用，包含 Chat、Cowork 和 Code 三种模式。在应用的开发者设置中填入 RayinAPI 的请求地址和 API Key，就可以不登录 Anthropic 账号直接使用

<Info>
  使用 RayinAPI 时，对话记录只保存在你的电脑本地，不会同步到 claude.ai
</Info>

## 下载安装

<Tabs>
  <Tab title="macOS">
    下载 [Claude Desktop for macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect)，打开 `.dmg` 文件，把 Claude 拖入「应用程序」文件夹
  </Tab>

  <Tab title="Windows">
    前往 [Claude 下载页](https://claude.com/download) 下载 Windows 安装包，运行后按提示完成安装
  </Tab>
</Tabs>

## 创建 API Key

在控制台 [创建 API Key](/quickstart/api-key) 时，「厂商」选择「Anthropic」

<img src="https://mintcdn.com/zller/XFjnjhUFHFsB_FnZ/images/api-key-claude.png?fit=max&auto=format&n=XFjnjhUFHFsB_FnZ&q=85&s=275d9389bce932f38de421aed55c0d29" alt="创建密钥时厂商选择 Anthropic" style={{maxWidth: '400px'}} width="976" height="1476" data-path="images/api-key-claude.png" />

## 配置 RayinAPI

<Steps>
  <Step title="开启开发者模式">
    打开 Claude Desktop，先不要登录

    * **macOS**：在屏幕顶部菜单栏点击「Help → Troubleshooting → Enable Developer Mode」
    * **Windows**：点击登录界面左上角的菜单按钮 ☰，选择「Help → Troubleshooting → Enable Developer Mode」

    应用会重启，菜单中多出「Developer」菜单
  </Step>

  <Step title="打开 API 设置窗口">
    点击菜单「Developer → Configure Third-Party Inference…」，打开配置窗口

    <img src="https://mintcdn.com/zller/XFjnjhUFHFsB_FnZ/images/claude-desktop-menu.png?fit=max&auto=format&n=XFjnjhUFHFsB_FnZ&q=85&s=343484866922dad65d6a5f1ef4bd6403" alt="Developer 菜单中的 Configure Third-Party Inference 选项" style={{maxWidth: '300px'}} width="582" height="900" data-path="images/claude-desktop-menu.png" />
  </Step>

  <Step title="填写连接信息">
    在左侧选择「Connection」，把顶部的下拉框设为「Gateway」，然后在「GATEWAY CREDENTIALS」中填写

    | 字段 | 填写内容 |
    | - | - |
    | Credential kind | `Static API key`（默认） |
    | Gateway base URL | `https://www.rayinai.com` |
    | Gateway API key | 你的 API Key（[如何生成](/quickstart/api-key)） |
    | Gateway auth scheme | `bearer`（默认） |

    <img src="https://mintcdn.com/zller/XFjnjhUFHFsB_FnZ/images/claude-desktop-connection.png?fit=max&auto=format&n=XFjnjhUFHFsB_FnZ&q=85&s=17bc568e1ff85719567966e07118574e" alt="Connection 页面，Gateway 凭证填写示例" style={{maxWidth: '600px'}} width="1800" height="1440" data-path="images/claude-desktop-connection.png" />

    <Warning>
      请求地址**不要**加 `/v1`，Claude Desktop 会自动拼接
    </Warning>
  </Step>

  <Step title="添加请求头">
    在同一页向下滚动到「Custom inference headers」，点击「+ Add」，左右两栏分别填写

    | 左栏（名称） | 右栏（值） |
    | - | - |
    | `User-Agent` | `claude-cli/2.1.280 (external, claude-desktop-3p, agent-sdk/0.3.280)` |

    <img src="https://mintcdn.com/zller/XFjnjhUFHFsB_FnZ/images/claude-desktop-headers.png?fit=max&auto=format&n=XFjnjhUFHFsB_FnZ&q=85&s=8b773c1a871a28e0f9973dc920d48846" alt="Custom inference headers 中填写 User-Agent" style={{maxWidth: '600px'}} width="1800" height="1440" data-path="images/claude-desktop-headers.png" />
  </Step>

  <Step title="测试连接">
    回到页面上方，点击「GATEWAY CREDENTIALS」右侧的「Test connection」，确认连接成功
  </Step>

  <Step title="应用配置">
    点击「Apply Changes」，应用会写入配置并自动重启

    <Note>
      不要点击「Export」，导出功能用于企业批量部署，个人使用不需要
    </Note>
  </Step>

  <Step title="跳过 Anthropic 登录">
    重启后，在登录界面选择跳过 Anthropic 登录、使用刚才配置的 RayinAPI，即可进入应用
  </Step>
</Steps>

## 验证

进入应用后，在 Chat 中发送任意消息，能正常回复即表示配置完成

如果模型选择列表为空，打开「Developer → Configure Third-Party Inference…」，在左上角「Search settings」中搜索 `models`，手动添加模型，例如 `claude-opus-5-5`，然后再次点击「Apply Changes」

## 遇到问题

<Card title="Claude Desktop 常见问题" icon="circle-question" href="/claude-desktop/faq">
  查看 Claude Desktop 配置相关的常见问题
</Card>


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