完全退出 Claude App
先完全退出 Claude App,不能只是关闭窗口。确认菜单栏或进程里已经没有 Claude App 在运行。
在 MacOS / Linux / Windows 上配置 Claude 桌面 APP 接入 ApirelayApi
MacOS 或 Linux 系统,已安装 Git,并能编辑本地 JSON 配置文件
~/Library/Application Support/Claude-3p/claude_desktop_config.json
先完全退出 Claude App,不能只是关闭窗口。确认菜单栏或进程里已经没有 Claude App 在运行。
打开下面路径中的配置文件。如果文件不存在,可以手动新建 claude_desktop_config.json。
~/Library/Application Support/Claude-3p/claude_desktop_config.json
将下面内容写入配置文件,并把 inferenceGatewayApiKey 替换为你在 ApirelayApi 创建的密钥。写入前建议先备份原配置;inferenceModels 可以按需调整为你希望在 App 内快速切换的模型。
{
"enterpriseConfig": {
"inferenceProvider": "gateway",
"inferenceGatewayBaseUrl": "https://apirelay.aiserverapp.com",
"inferenceGatewayApiKey": "替换为你的密钥",
"inferenceGatewayAuthScheme": "auto",
"disableAutoUpdates": true,
"disableEssentialTelemetry": true,
"disableNonessentialTelemetry": true,
"disableNonessentialServices": true,
"inferenceModels": [
"claude-opus-4-7",
"claude-sonnet-4-7"
],
"deploymentOrganizationUuid": "00000000-0000-4000-8000-000000000001"
}
}
首次启动会拉取 downloads.claude.ai 的 VM/rootfs 资源。如果卡在 Setting up Claude's workspace...,请临时切换到能访问外网的网络,完成一次下载即可。
重新启动 Claude App,新建一个对话并发送测试消息,确认请求已经通过 ApirelayApi 网关转发。
首次启动 Claude App 时,如果停在 Setting up Claude's workspace...,通常是 workspace 资源下载受阻。请临时切换到能访问外网的网络,完成第一次下载后再回到常用网络。
Windows 10/11,已安装 Git,并能使用任务管理器和管理员 PowerShell
C:\users\你的用户\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude-3p\claude_desktop_config.json
不同安装版本的包名可能略有差异;如果路径不存在,请在资源管理器里搜索 claude_desktop_config.json 定位真实文件。
打开任务管理器,确认所有 claude.exe 进程都已经结束,避免保存配置时被 App 覆盖。
打开下面路径中的配置文件,并将“你的用户”替换成当前 Windows 用户名。
C:\users\你的用户\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude-3p\claude_desktop_config.json
将下面内容写入配置文件,并把 inferenceGatewayApiKey 替换为你在 ApirelayApi 创建的密钥。此操作会覆盖原配置,写入前建议先备份。
{
"deploymentMode": "3p",
"enterpriseConfig": {
"disableAutoUpdates": true,
"disableNonessentialServices": true,
"deploymentOrganizationUuid": "00000000-0000-4000-8000-000000000001",
"disableNonessentialTelemetry": true,
"inferenceProvider": "gateway",
"inferenceModels": [
"claude-opus-4-7",
"claude-sonnet-4-7"
],
"disableEssentialTelemetry": true,
"inferenceGatewayBaseUrl": "https://apirelay.aiserverapp.com",
"inferenceGatewayApiKey": "替换为你的密钥",
"inferenceGatewayAuthScheme": "auto"
},
"_cfprefsMigrated": true,
"preferences": {
"coworkScheduledTasksEnabled": true,
"ccdScheduledTasksEnabled": false,
"sidebarMode": "task",
"coworkWebSearchEnabled": true
}
}
保存配置文件后重新启动 Claude App,等待 App 读取新的企业网关配置。
首次如果出现 Setting up Claude's workspace...,需要临时切换到能访问外网的网络,让 Claude App 完成一次资源下载。
如果提示 Virtual Machine Platform not available,请使用管理员 PowerShell 执行以下命令并重启。
PS> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
PS> dism.exe /online /enable-feature /featurename:HypervisorPlatform /all /norestart
PS> bcdedit /set hypervisorlaunchtype auto
PS> shutdown /r /t 0
也可以移动到软件左上角,按 App 提供的快速安装提示完成配置后重启。
首次启动 Claude App 时,如果停在 Setting up Claude's workspace...,通常是 workspace 资源下载受阻。请临时切换到能访问外网的网络,完成第一次下载后再回到常用网络。