配置文档

基础接入参数

在配置任何 CLI 工具前,请确保您已有可用的 API Key (令牌)。

API 基础地址: https://cdn.omgcloud.top/v1
API Key: sk-xxxxxxxxxxxxxxxx

* 请注意:大多数 CLI 工具要求地址必须包含 /v1 后缀。

推荐使用 cc-switch 简化配置操作

macOS / Linux 配置 (Zsh/Bash)

通过修改 Shell 配置文件实现永久生效。

1. 修改配置文件

# 如果使用 Zsh (macOS 默认)
nano ~/.zshrc

# 如果使用 Bash
nano ~/.bash_profile

2. 添加环境变量

在文件末尾添加以下行:

# Claude Code 配置
export CLAUDE_BASE_URL="https://cdn.omgcloud.top/v1"

# 通用 OpenAI 兼容工具配置 (如 aichat)
export OPENAI_API_BASE="https://cdn.omgcloud.top/v1"
export OPENAI_API_KEY="您的sk令牌"

3. 使配置生效

source ~/.zshrc  # 或对应的配置文件

Windows 配置 (PowerShell)

针对 Windows 用户,推荐使用 PowerShell 进行配置。

1. 临时生效 (当前会话)

$env:CLAUDE_BASE_URL = "https://cdn.omgcloud.top/v1"
$env:OPENAI_API_BASE = "https://cdn.omgcloud.top/v1"

2. 永久生效 (推荐)

运行以下命令将其保存到用户环境变量中:

[Environment]::SetEnvironmentVariable("CLAUDE_BASE_URL", "https://cdn.omgcloud.top/v1", "User")
[Environment]::SetEnvironmentVariable("OPENAI_API_BASE", "https://cdn.omgcloud.top/v1", "User")
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "您的sk令牌", "User")
注意: 设置永久环境变量后,请重启您的终端(如 VS Code 终端或 PowerShell 窗口)以加载新变量。