easy4ai.com 使用文档
Claude Code - Windows
1. 安装 Node.js
访问 nodejs.org 下载 LTS 版本(需 18+),按向导安装。
# 验证安装
node --version
npm --version
2. 安装 Claude Code
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
3. 配置
编辑 C:\Users\你的用户名\.claude\settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "你的API密钥",
"ANTHROPIC_BASE_URL": "https://easy4ai.com"
}
}
或设置环境变量(PowerShell 永久设置):
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://easy4ai.com", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "你的API密钥", [System.EnvironmentVariableTarget]::User)
4. 使用
claude
Claude Code - Linux
1. 安装 Node.js
# 添加 NodeSource 仓库并安装
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
2. 安装 Claude Code
npm install -g @anthropic-ai/claude-code
3. 配置环境变量
# 永久设置 (bash)
echo 'export ANTHROPIC_BASE_URL="https://easy4ai.com"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.bashrc
source ~/.bashrc
4. 使用
claude
Claude Code - Mac
1. 安装 Node.js
# 使用 Homebrew
brew install node
2. 安装 Claude Code
npm install -g @anthropic-ai/claude-code
3. 配置环境变量
# 永久设置 (zsh)
echo 'export ANTHROPIC_BASE_URL="https://easy4ai.com"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="你的API密钥"' >> ~/.zshrc
source ~/.zshrc
4. 使用
claude
Claude Code - VSCode
前提:请先按照对应系统配置好 Claude Code CLI。
1. 安装扩展
在 VSCode 扩展市场搜索并安装 Claude Code for VS Code。
2. 配置
在 .claude/config.json 中添加:
{
"primaryApiKey": "key"
}
注意:是 config.json,不是 settings.json。Cursor 编辑器使用相同配置。
Codex - Windows
1. 安装 Node.js
同 Claude Code,需要 Node.js 18+。
2. 安装 Codex
npm i -g @openai/codex --registry=https://registry.npmmirror.com
3. 配置
创建 C:\Users\你的用户名\.codex\config.toml:
model_provider = "custom"
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
disable_response_storage = true
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://easy4ai.com/v1"
创建 auth.json:
{
"OPENAI_API_KEY": "你的API密钥"
}
4. 使用
codex
Codex - Linux
1. 安装
npm install -g @openai/codex
2. 配置环境变量
echo 'export OPENAI_BASE_URL="https://easy4ai.com/v1"' >> ~/.bashrc
echo 'export OPENAI_API_KEY="你的API密钥"' >> ~/.bashrc
source ~/.bashrc
3. 使用
codex
Codex - Mac
1. 安装
npm install -g @openai/codex
2. 配置环境变量
echo 'export OPENAI_BASE_URL="https://easy4ai.com/v1"' >> ~/.zshrc
echo 'export OPENAI_API_KEY="你的API密钥"' >> ~/.zshrc
source ~/.zshrc
3. 使用
codex
Codex - VSCode
1. 安装扩展
在 VSCode 扩展市场搜索并安装 Codex - OpenAI's coding agent。
2. 配置
在 ~/.codex/auth.json:
{
"OPENAI_API_KEY": "你的API密钥"
}
在 ~/.codex/config.toml:
model_provider = "custom"
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
disable_response_storage = true
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://easy4ai.com/v1"
在 ~/.codex/auth.json 中配置 OPENAI_API_KEY 为你的 API 密钥。
计费规则
Token 计费公式
配额消耗 = (输入Token + 输出Token × 完成倍率) × 模型倍率 × 用户组倍率
模型倍率参考
| 模型 | 输入倍率 | 输出倍率 |
|---|---|---|
| gpt-5.2 | 1 | 1 |
| claude-sonnet-4-5-20250929 | 1 | 1 |
注意:目前本站倍率为官方1:1。