kyAPI 官方接入指南

kyAPI Official Integration Guide

新一代 AI 大模型中转服务平台 · 稳定可靠 · 极速响应

Next-Gen AI Model Relay Platform · Stable & Reliable · Lightning Fast

📖
📢 官方访问地址 📢 Official Access URLs

主站(江苏/福建用户优先推荐): Main Sites:

API 接口地址: API Endpoints:

  • 总接口:Main: https://api.haiyawl.com
  • 日本节点:Japan: https://api.haiyawl.com
  • 香港节点:Hong Kong: https://api.haiyawl.com
⚠️ 无法访问? ⚠️ Cannot Access?

请使用系统自带浏览器(Chrome、Edge、Safari)访问。切勿使用 UC、夸克、百度、QQ 等带有审核机制的浏览器。
推荐使用 VIA 浏览器(轻量、无广告)。
Please use system browsers (Chrome, Edge, Safari). Do NOT use browsers with built-in censorship like UC, Quark, Baidu, or QQ browsers.
We recommend VIA Browser (lightweight, ad-free).

控制台快捷入口

Console Quick Links

📝 注册账号

📝 Registration

按照以下步骤完成账号注册,只需 1 分钟:

Follow these steps to complete registration in just 1 minute:

1

打开注册页面

Open Registration Page

访问 api.haiyawl.com,关闭公告弹窗后,点击右上角「注册」按钮。

Visit api.haiyawl.com, close the announcement popup, then click the "Register" button in the top right corner.

2

填写注册信息

Fill in Registration Info

  • 用户名:自定义一个好记的名字
  • 密码:设置一个复杂且容易记住的密码
  • 邮箱:填写常用邮箱(用于接收验证码和找回密码)
  • Username: Choose a memorable name
  • Password: Set a complex but memorable password
  • Email: Enter your email (for verification code and password recovery)
3

获取邮箱验证码

Get Email Verification Code

点击「获取验证码」按钮,验证码会发送到您的邮箱。
💡 如果没有收到,请检查垃圾邮件文件夹,或刷新页面重试。

Click "Get Verification Code" button, the code will be sent to your email.
💡 If not received, check your spam folder or refresh the page and try again.

4

完成注册

Complete Registration

填入验证码,勾选「已阅读并同意服务条款」,点击「注册」即可完成。

Enter the verification code, check "I have read and agree to the Terms of Service", then click "Register" to complete.

✨ 注册成功! ✨ Registration Complete!

新用户注册即送免费体验额度,可直接开始使用,无需充值! New users receive free trial credits upon registration - start using immediately without payment!

🔑 令牌与分组管理

🔑 Token & Group Management

获取 API 令牌

Get API Token

注册完成后,进入「控制台 → 令牌管理」页面:

After registration, go to "Console → Token Management" page:

1

查看初始令牌

View Initial Token

系统已为您自动创建一个初始令牌,该令牌的分组涵盖了站点绝大多数模型,可以直接复制使用。

The system has automatically created an initial token for you. This token's group covers most models on the platform and can be used directly.

2

复制令牌

Copy Token

点击令牌旁边的复制按钮。如果复制失败,可以点击「小眼睛」图标显示完整令牌,然后手动复制。

Click the copy button next to the token. If copying fails, click the "eye" icon to reveal the full token, then copy manually.

⚠️ 请确保复制完整,令牌格式为 sk-xxxxxxxxxxxxxxxx ⚠️ Ensure you copy the complete token, format: sk-xxxxxxxxxxxxxxxx

什么是分组?

What are Groups?

分组决定了您的请求通过哪条渠道处理。不同分组有不同的:

Groups determine which channel processes your requests. Different groups have different:

  • 价格:部分专用分组价格更优惠
  • 功能:某些分组支持特定功能(如联网搜索)
  • 模型范围:不同分组可调用的模型不同
  • Pricing: Some dedicated groups offer better rates
  • Features: Certain groups support specific features (e.g., web search)
  • Model Range: Different groups can access different models

⚠️ 选错分组可能导致请求失败或功能受限,请根据您的使用场景选择合适的分组。 ⚠️ Choosing the wrong group may cause request failures or limited functionality. Please select the appropriate group for your use case.

分组对照表

Group Reference Table

分组名称 Group Name 适用场景 Use Case 说明 Description
default 默认分组 Default Group 按量计费模型,不切换分组时默认使用 Pay-per-use models, used by default when no group is selected
auto / all 通用 · 推荐 General · Recommended 享用站点几乎所有服务,适合日常聊天、Chatbox、Rikka 等软件 Access to almost all services, suitable for daily chat, Chatbox, Rikka, etc.
once 按次计费 Per-Request Billing 内含所有按次计费的模型 Includes all per-request billing models
claudecode Claude Code / 办公 / 工程 Claude Code / Office / Engineering 价格优惠,需使用 Anthropic 原生格式调用(兼容 OpenAI 自定义
⚠️ 仅推荐工程/办公场景
Discounted pricing, requires Anthropic native format (compatible with OpenAI Custom)
⚠️ Recommended for engineering/office use
claudecodecheap Claude Code / 工程(更优惠) Claude Code / Engineering (Cheaper) 更优惠价格,需使用 Anthropic 原生格式调用(兼容 OpenAI 自定义
⚠️ 仅推荐工程/办公场景
Lower pricing, requires Anthropic native format (compatible with OpenAI Custom)
⚠️ Recommended for engineering/office use
claudecheap Claude(更优惠) Claude (Cheaper) 更优惠价格,需使用 Anthropic 原生格式调用(兼容 OpenAI 自定义 Lower pricing, requires Anthropic native format (compatible with OpenAI Custom)
awsclaude AWS Claude(Claude 原生格式) AWS Claude (Claude native format) 适用于需要 Claude 原生格式的应用;使用 Anthropic 原生格式(兼容 OpenAI 自定义 For clients that require Claude native format; uses Anthropic native format (compatible with OpenAI Custom)
gemini Gemini CLI / AI 绘图 Gemini CLI / AI Drawing 支持 Google Search 联网、NanoBanana 连续改图;兼容 OpenAI 自定义 Supports Google Search and NanoBanana continuous image editing; compatible with OpenAI Custom
azureopenai CodeX / OpenAI 模型 CodeX / OpenAI Models 智能代码补全、代码审查 Intelligent code completion, code review

如何修改令牌分组

How to Modify Token Group

  1. 在「令牌管理」页面找到需要修改的令牌
  2. 点击「编辑」按钮
  3. 在弹出窗口中可以设置:
    • 令牌使用时间限制
    • 使用额度上限
    • 可访问的模型
    • 访问 IP 限制
    • 令牌分组(重点)
  4. 选择合适的分组后保存即可
  1. Find the token you want to modify on the "Token Management" page
  2. Click the "Edit" button
  3. In the popup window, you can set:
    • Token usage time limit
    • Usage quota limit
    • Accessible models
    • IP restrictions
    • Token group (important)
  4. Select the appropriate group and save
⚠️ 安全提示 ⚠️ Security Notice
  • API 令牌等同于您的账户密码,请妥善保管
  • 不要在公开场合(如 GitHub、论坛)暴露您的令牌
  • 如怀疑令牌泄露,请立即在控制台删除并重新创建
  • API tokens are equivalent to your account password - keep them safe
  • Never expose your tokens in public places (GitHub, forums, etc.)
  • If you suspect a token leak, immediately delete and recreate it in the console

💰 充值与额度

💰 Payment & Credits

充值方式

Payment Methods

在「控制台 → 钱包」页面进行充值:

Top up on the "Console → Wallet" page:

在线支付

Online Payment

即时到账 Instant credit

  • ✓ 支付宝
  • ✓ Alipay
  • ✓ 微信支付
  • ✓ WeChat Pay
  • ✓ Creem(Credit Card (Visa/Mastercard))
  • ✓ Creem (Credit Card (Visa/Mastercard))

兑换码充值

Redemption Code

活动获取 From events

  • ✓ 确保无多余符号
  • ✓ 填入兑换码输入框
  • ✓ 点击「兑换额度」
  • ✓ Ensure no extra characters
  • ✓ Enter in redemption code field
  • ✓ Click "Redeem Credits"

查看余额

Check Balance

个人中心 Personal Center

  • ✓ 当前可用余额
  • ✓ 消费明细记录
  • ✓ 使用日志查询
  • ✓ Current available balance
  • ✓ Transaction history
  • ✓ Usage logs
💡 充值说明 💡 Payment Notes
  • 支付完成后余额可能不会立刻刷新显示,但已经可以正常使用
  • 如不放心,可在「使用日志」中查看是否有充值记录
  • 如因网络波动导致充值未到账,请联系首页客服补充
  • Balance may not refresh immediately after payment, but you can still use it
  • Check "Usage Logs" for payment records if uncertain
  • If payment didn't arrive due to network issues, contact customer service

计费说明

Billing Information

kyAPI 采用按 Token 用量计费的模式,不同模型价格不同。完整定价请查看「模型价格」页面。

kyAPI uses pay-per-token billing. Different models have different prices. See the "Model Pricing" page for complete pricing.

💡 省钱技巧 💡 Money-Saving Tips
  • 使用专用分组(如 claudecode / claudecodecheap / claudecheap)通常比通用分组更便宜
  • 合理控制上下文长度,避免无谓的 Token 消耗
  • 关注官方活动,不定期有充值优惠
  • Dedicated groups (e.g., claudecode / claudecodecheap / claudecheap) are usually cheaper than general groups
  • Control context length to avoid unnecessary token consumption
  • Follow official events for occasional top-up discounts

📡 接口调用示例

📡 API Usage Examples

如果您是开发者,可以直接通过 HTTP 请求调用 API。以下是常用的调用示例:

If you're a developer, you can call the API directly via HTTP requests. Here are common examples:

OpenAI 兼容格式(推荐)

OpenAI Compatible Format (Recommended)

bash
curl https://api.haiyawl.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [
      {"role": "user", "content": "Hello! Please introduce yourself."}
    ],
    "stream": true
  }'
python
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxxxxxxxxxxxx",
    base_url="https://api.haiyawl.com/v1"
)

response = client.chat.completions.create(
    model="claude-sonnet-4-20250514",
    messages=[
        {"role": "user", "content": "Hello! Please introduce yourself."}
    ],
    stream=True
)

for chunk in response:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

安装依赖:pip install openai Install dependency: pip install openai

javascript
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: 'sk-xxxxxxxxxxxxxxxx',
    baseURL: 'https://api.haiyawl.com/v1'
});

async function main() {
    const stream = await client.chat.completions.create({
        model: 'claude-sonnet-4-20250514',
        messages: [
            { role: 'user', content: 'Hello! Please introduce yourself.' }
        ],
        stream: true
    });

    for await (const chunk of stream) {
        process.stdout.write(chunk.choices[0]?.delta?.content || '');
    }
}

main();

安装依赖:npm install openai Install dependency: npm install openai

🔔 注意事项 🔔 Important Notes

将示例中的 sk-xxxxxxxxxxxxxxxx 替换为您在控制台获取的 API 令牌。令牌已包含 sk- 前缀,请勿重复添加。 Replace sk-xxxxxxxxxxxxxxxx with your API token from the console. The token already includes the sk- prefix - do not add it again.

🛠️ 开发者工具 (CLI) 接入指南

🛠️ Developer Tools (CLI) Integration Guide

🚀

Claude Code

Anthropic 官方 CLI 工具,Claude Sonnet 4 驱动

Official Anthropic CLI Tool, powered by Claude Sonnet 4

⚠️ 分组选择说明(重要) ⚠️ Group Selection Guide (Important)
  • 代码开发/工程重构(价格优惠):使用 claudecodeclaudecodecheap 分组
  • Code development/engineering (discounted): Use claudecode or claudecodecheap group
📋 系统要求 📋 System Requirements
  • Windows 10 or Windows 11
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

方法一:使用官方安装包(推荐)
Method 1: Official Installer (Recommended)
  1. 访问 https://nodejs.org
  2. 下载 LTS 版本的 Windows Installer (.msi)
  3. 运行安装程序,按默认设置完成安装
  4. 安装程序会自动添加到 PATH 环境变量
  1. Visit https://nodejs.org
  2. Download the LTS version Windows Installer (.msi)
  3. Run the installer with default settings
  4. The installer will automatically add to PATH
方法二:使用包管理器
Method 2: Using Package Manager

使用 Winget(Windows 11 或 Windows 10 自带):Using Winget (built into Windows 11/10):

PowerShell (管理员Admin)
winget install OpenJS.NodeJS.LTS

使用 Chocolatey:Using Chocolatey:

PowerShell (管理员Admin)
choco install nodejs-lts

使用 Scoop:Using Scoop:

PowerShell
scoop install nodejs-lts

验证安装:Verify installation:

CMD/PowerShell
node --version
npm --version

💡 提示:建议使用 LTS(长期支持)版本以获得最佳稳定性。安装完成后需重启命令行窗口 💡 Tip: Use the LTS version for best stability. Restart your terminal after installation.

2

安装 Claude Code CLI

Install Claude Code CLI

打开命令提示符(以管理员身份运行)或 PowerShell,执行以下命令:

Open Command Prompt (Run as Administrator) or PowerShell, execute:

CMD/PowerShell
npm install -g @anthropic-ai/claude-code

验证安装:

Verify installation:

CMD/PowerShell
claude --version

⚠️ 注意:如果遇到权限问题,请确保以管理员身份运行命令提示符。 ⚠️ Note: If you encounter permission issues, ensure you run Command Prompt as Administrator.

3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理 进行以下操作:

Visit kyAPI Token Management and:

  • 点击「添加令牌」
  • 令牌分组请选择:claudecodecheap(推荐)或 claudecode
  • 令牌名称:随意填写(如 "Claude Code")
  • 额度建议:设置为无限额度
  • 其他选项保持默认
  • 点击确认,复制生成的令牌
  • Click "Add Token"
  • Select group: claudecodecheap (recommended) or claudecode
  • Token name: Any name (e.g., "Claude Code")
  • Quota: Recommended unlimited
  • Keep other options as default
  • Confirm and copy the generated token
4

配置环境变量

Configure Environment Variables

配置位置:Config location: %USERPROFILE%\.claude\settings.json

  1. Win + R,输入 %USERPROFILE% 回车,打开用户目录
  2. 创建 .claude 文件夹(注意开头有个点)
  3. .claude 文件夹内创建 settings.json 文件
  4. 用记事本打开,粘贴以下内容:
  1. Press Win + R, type %USERPROFILE% and press Enter to open user directory
  2. Create .claude folder (note the dot at the beginning)
  3. Create settings.json file inside the .claude folder
  4. Open with Notepad and paste the following:
settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://api.haiyawl.com",
    "API_TIMEOUT_MS": "600000"
  }
}
⚠️ 重要提示 ⚠️ Important

请将 sk-xxxxxxxxxxxxxxxx 替换为您在 kyAPI 令牌管理 生成的 claudecodecheapclaudecode 分组令牌! Replace sk-xxxxxxxxxxxxxxxx with your claudecodecheap or claudecode group token from kyAPI Token Management!

5

启动 Claude Code

Launch Claude Code

配置完成后,先进入到工程目录:

After configuration, first navigate to your project directory:

CMD/PowerShell
cd your-project-folder

然后启动:

Then launch:

CMD/PowerShell
claude

首次启动配置:First launch setup:

  • 选择喜欢的主题(回车)
  • 确认安全须知(回车)
  • 使用默认 Terminal 配置(回车)
  • 信任工作目录(回车)
  • 开始编程!🚀
  • Select preferred theme (Enter)
  • Confirm security notice (Enter)
  • Use default Terminal config (Enter)
  • Trust working directory (Enter)
  • Start coding! 🚀
📋 系统要求 📋 System Requirements
  • macOS 10.15 (Catalina) 或更高版本or higher
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

方法一:使用 Homebrew(推荐)
Method 1: Using Homebrew (Recommended)

如果尚未安装 Homebrew:

If Homebrew is not installed:

Terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

使用 Homebrew 安装 Node.js:

Install Node.js with Homebrew:

Terminal
brew install node
方法二:使用官方安装包
Method 2: Official Installer
  1. 访问 https://nodejs.org
  2. 下载 LTS 版本的 macOS Installer (.pkg)
  3. 运行安装程序,按默认设置完成安装
  1. Visit https://nodejs.org
  2. Download LTS version macOS Installer (.pkg)
  3. Run installer with default settings

验证安装:Verify installation:

Terminal
node --version
npm --version
2

安装 Claude Code CLI

Install Claude Code CLI

打开终端,执行以下命令:

Open Terminal and execute:

Terminal
npm install -g @anthropic-ai/claude-code

验证安装:

Verify installation:

Terminal
claude --version
3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理 进行以下操作:

Visit kyAPI Token Management and:

  • 点击「添加令牌」
  • 令牌分组请选择:claudecodecheap(推荐)或 claudecode
  • 令牌名称:随意填写
  • 额度建议:设置为无限额度
  • 复制生成的令牌
  • Click "Add Token"
  • Select group: claudecodecheap (recommended) or claudecode
  • Token name: Any name
  • Quota: Recommended unlimited
  • Copy the generated token
4

配置环境变量

Configure Environment Variables

配置位置:Config location: ~/.claude/settings.json

Terminal
# 创建配置目录 / Create config directory
mkdir -p ~/.claude

# 创建并编辑配置文件 / Create and edit config file
nano ~/.claude/settings.json

粘贴以下内容,然后按 Ctrl+X,按 Y,按 Enter 保存:

Paste the following, then press Ctrl+X, Y, Enter to save:

settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://api.haiyawl.com",
    "API_TIMEOUT_MS": "600000"
  }
}
⚠️ 重要提示 ⚠️ Important

请将 sk-xxxxxxxxxxxxxxxx 替换为您的 claudecodecheapclaudecode 分组令牌! Replace sk-xxxxxxxxxxxxxxxx with your claudecodecheap or claudecode group token!

5

启动 Claude Code

Launch Claude Code

Terminal
cd your-project-folder
claude

首次启动配置:First launch setup: 选择主题 → 确认须知 → 信任目录 → 开始编程!🚀Select theme → Confirm notice → Trust directory → Start coding! 🚀

📋 系统要求 📋 System Requirements
  • Linux (Ubuntu 18.04+, CentOS 7+, Debian 9+, Arch)
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

方法一:使用官方安装包(推荐)
Method 1: Official Binaries (Recommended)
  1. 访问 https://nodejs.org
  2. 下载 LTS 版本的 Linux Binaries
  3. 解压并安装到系统目录
  4. 配置 PATH 环境变量
  1. Visit https://nodejs.org
  2. Download LTS version Linux Binaries
  3. Extract and install to system directory
  4. Configure PATH environment variable
方法二:使用包管理器
Method 2: Using Package Manager

Ubuntu/Debian:

Terminal
# 更新软件包列表 / Update package list
sudo apt update

# 方法一:使用系统仓库 / Method 1: System repo
sudo apt install -y nodejs npm

# 方法二:使用 NodeSource(推荐)/ Method 2: NodeSource (Recommended)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

CentOS/RHEL/Fedora:

Terminal
# Fedora
sudo dnf install -y nodejs npm

# CentOS/RHEL
sudo yum install -y nodejs npm

Arch Linux:

Terminal
sudo pacman -S nodejs npm

验证安装:Verify installation:

Terminal
node --version
npm --version
2

安装 Claude Code CLI

Install Claude Code CLI

Terminal
npm install -g @anthropic-ai/claude-code
claude --version

💡 权限问题?如果遇到权限错误,可以使用 sudo npm install -g @anthropic-ai/claude-code 💡 Permission issues? Use sudo npm install -g @anthropic-ai/claude-code

3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理,创建 claudecodecheap(推荐)或 claudecode 分组令牌并复制。

Visit kyAPI Token Management, create a claudecodecheap (recommended) or claudecode group token, then copy it.

4

配置环境变量

Configure Environment Variables

配置位置:Config location: ~/.claude/settings.json

Terminal
# 创建配置目录和文件 / Create config directory and file
mkdir -p ~/.claude

cat > ~/.claude/settings.json << 'EOF'
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://api.haiyawl.com",
    "API_TIMEOUT_MS": "600000"
  }
}
EOF

⚠️ 编辑文件,将 sk-xxxxxxxxxxxxxxxx 替换为您的令牌:nano ~/.claude/settings.json ⚠️ Edit file, replace sk-xxxxxxxxxxxxxxxx with your token: nano ~/.claude/settings.json

5

启动 Claude Code

Launch Claude Code

Terminal
cd your-project-folder
claude

CodeX

企业级 AI 编程助手,GPT系列 驱动

Enterprise AI Coding Assistant, powered by GPT

💡 分组选择 💡 Group Selection

推荐使用 azureopenai 分组,也支持 autoall Recommended: azureopenai group, also supports auto or all

📋 系统要求📋 System Requirements
  • Windows 10 or Windows 11
  • Node.js 18+ (参考 Claude Code 部分安装refer to Claude Code section)
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

如果已在 Claude Code 部分安装过,可跳过此步骤。否则请参考上方 Claude Code 的 Node.js 安装步骤。

If already installed during Claude Code setup, skip this step. Otherwise, refer to Claude Code section above.

2

安装 CodeX CLI

Install CodeX CLI

打开命令提示符(以管理员身份运行)或 PowerShell:

Open Command Prompt (Run as Administrator) or PowerShell:

CMD/PowerShell
npm install -g @openai/codex@latest

验证安装:

Verify installation:

CMD/PowerShell
codex --version
3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理 进行以下操作:

Visit kyAPI Token Management:

  • 点击「添加令牌」
  • 令牌分组请选择:azureopenaiautoall
  • 令牌名称:随意填写(如 "CodeX")
  • 复制生成的令牌
  • Click "Add Token"
  • Select group: azureopenai, auto, or all
  • Token name: Any name (e.g., "CodeX")
  • Copy the generated token
4

创建配置文件

Create Config Files

  1. Win + R,输入 %USERPROFILE% 回车
  2. 创建 .codex 文件夹
  3. 在文件夹内创建以下两个文件:
  1. Press Win + R, type %USERPROFILE% and Enter
  2. Create .codex folder
  3. Create the following two files inside:

config.toml 文件file:

config.toml
model_provider = "kyapi"
model = "gpt-5.3-codex"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true

[model_providers.kyapi]
name = "kyapi"
base_url = "https://api.haiyawl.com/v1"
wire_api = "responses"
requires_openai_auth = true

auth.json 文件file:

auth.json
{
  "OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}

⚠️ 将 sk-xxxxxxxxxxxxxxxx 替换为您的 kyAPI 令牌! ⚠️ Replace sk-xxxxxxxxxxxxxxxx with your kyAPI token!

5

启动 CodeX

Launch CodeX

CMD/PowerShell
cd your-project-folder
codex

首次运行配置:First run setup:

  • 选择您的开发环境配置
  • 配置代码生成偏好
  • 设置推理等级
  • 开始 AI 辅助编程!🚀
  • Select your development environment
  • Configure code generation preferences
  • Set reasoning level
  • Start AI-assisted coding! 🚀
📋 系统要求📋 System Requirements
  • macOS 10.15 (Catalina) 或更高版本or higher
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js & CodeX CLI

Install Node.js & CodeX CLI

Terminal
# 安装 Node.js(如已安装可跳过)/ Install Node.js (skip if installed)
brew install node

# 安装 CodeX / Install CodeX
npm install -g @openai/codex@latest
codex --version
2

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理,创建 azureopenaiautoall 分组令牌。

Visit kyAPI Token Management, create a azureopenai, auto, or all group token.

3

创建配置文件

Create Config Files

Terminal
# 创建配置目录 / Create config directory
mkdir -p ~/.codex
cd ~/.codex

# 创建 config.toml
cat > config.toml << 'EOF'
model_provider = "kyapi"
model = "gpt-5.3-codex"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true

[model_providers.kyapi]
name = "kyapi"
base_url = "https://api.haiyawl.com/v1"
wire_api = "responses"
requires_openai_auth = true
EOF

# 创建 auth.json
cat > auth.json << 'EOF'
{
  "OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}
EOF

⚠️ 编辑 auth.json,替换为您的令牌:nano ~/.codex/auth.json ⚠️ Edit auth.json, replace with your token: nano ~/.codex/auth.json

4

启动 CodeX

Launch CodeX

Terminal
cd your-project-folder
codex
📋 系统要求📋 System Requirements
  • Linux (Ubuntu 18.04+, CentOS 7+, Debian 9+)
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

请参考上方 Claude Code 部分的 Linux Node.js 安装步骤。

Refer to the Linux Node.js installation in Claude Code section above.

2

安装 CodeX CLI

Install CodeX CLI

Terminal
sudo npm install -g @openai/codex@latest
codex --version
3

获取令牌 & 创建配置

Get Token & Create Config

访问 kyAPI 令牌管理 获取令牌,然后创建配置:

Visit kyAPI Token Management to get token, then create config:

Terminal
# 创建配置目录 / Create config directory
mkdir -p ~/.codex

# 创建 config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "kyapi"
model = "gpt-5.3-codex"
model_reasoning_effort = "high"
network_access = "enabled"
disable_response_storage = true

[model_providers.kyapi]
name = "kyapi"
base_url = "https://api.haiyawl.com/v1"
wire_api = "responses"
requires_openai_auth = true
EOF

# 创建 auth.json
cat > ~/.codex/auth.json << 'EOF'
{
  "OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
}
EOF

⚠️ 编辑替换令牌:nano ~/.codex/auth.json ⚠️ Edit and replace token: nano ~/.codex/auth.json

4

启动 CodeX

Launch CodeX

Terminal
cd your-project-folder
codex

💻 VSCode 插件配置

💻 VSCode Extension Configuration

适用于所有平台(Windows / macOS / Linux)

Applies to all platforms (Windows / macOS / Linux)

配置步骤:Configuration Steps:

  1. 确保已安装 ChatGPT/CodeX 相关的 VSCode 扩展插件
  2. 打开 VSCode 的 settings.json 文件
    • Windows: Ctrl + Shift + P → 输入 "Preferences: Open Settings (JSON)"
    • macOS: Cmd + Shift + P → 输入 "Preferences: Open Settings (JSON)"
  3. 添加以下配置:
  1. Ensure ChatGPT/CodeX VSCode extension is installed
  2. Open VSCode settings.json file
    • Windows: Ctrl + Shift + P → type "Preferences: Open Settings (JSON)"
    • macOS: Cmd + Shift + P → type "Preferences: Open Settings (JSON)"
  3. Add the following configuration:
settings.json
{
  "chatgpt.apiBase": "https://api.haiyawl.com/v1",
  "chatgpt.config": {
    "preferred_auth_method": "apikey",
    "apiKey": "sk-xxxxxxxxxxxxxxxx"
  }
}

💡 配置完成后重启 VSCode 以确保设置生效。 💡 Restart VSCode after configuration to apply settings.

💎

Gemini CLI

Google AI 编程助手,Gemini 2.5 Pro 驱动

Google AI Coding Assistant, powered by Gemini 2.5 Pro

🌟 核心特性

🌟 Key Features

  • 🌐 超大上下文窗口Massive Context Window: 1M tokens
  • 🤖 Agent Mode: 自动规划任务Automatic task planning
  • 🔍 Google Search: 实时联网搜索Real-time web search
💎 分组选择 💎 Group Selection

推荐使用 gemini 分组(Google AI Studio 原生),也支持 autoall Recommended: gemini group (Google AI Studio native), also supports auto or all

Google AI Studio:https://api.haiyawl.com Google AI Studio: https://api.haiyawl.com

📋 系统要求📋 System Requirements
  • Windows 10 or Windows 11
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

如果已安装过,可跳过此步骤。否则请参考上方 Claude Code 的 Node.js 安装步骤。

If already installed, skip this step. Otherwise, refer to Claude Code section above.

2

安装 Gemini CLI

Install Gemini CLI

CMD/PowerShell
npm install -g @google/gemini-cli

验证安装:

Verify installation:

CMD/PowerShell
gemini --version
3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理 进行以下操作:

Visit kyAPI Token Management:

  • 点击「添加令牌」
  • 令牌分组请选择:geminiautoall
  • 令牌名称:随意填写(如 "Gemini CLI")
  • 复制生成的令牌
  • Click "Add Token"
  • Select group: gemini, auto, or all
  • Token name: Any name (e.g., "Gemini CLI")
  • Copy the generated token
4

创建配置文件

Create Config Files

  1. Win + R,输入 %USERPROFILE% 回车
  2. 创建 .gemini 文件夹
  3. 在文件夹内创建以下两个文件:
  1. Press Win + R, type %USERPROFILE% and Enter
  2. Create .gemini folder
  3. Create the following two files inside:

.env 文件file:

.env
GOOGLE_GEMINI_BASE_URL=https://api.haiyawl.com
GEMINI_API_KEY=sk-xxxxxxxxxxxxxxxx
GEMINI_MODEL=gemini-2.5-pro

settings.json 文件file:

settings.json
{
  "ide": {
    "enabled": true
  },
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  }
}

⚠️ 将 .env 文件中的 sk-xxxxxxxxxxxxxxxx 替换为您的令牌! ⚠️ Replace sk-xxxxxxxxxxxxxxxx in the .env file with your token!

5

启动 Gemini CLI

Launch Gemini CLI

CMD/PowerShell
gemini

开始使用 Gemini CLI!🚀

Start using Gemini CLI! 🚀

📋 系统要求📋 System Requirements
  • macOS 10.15 (Catalina) 或更高版本or higher
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

Terminal
brew install node
2

安装 Gemini CLI

Install Gemini CLI

Terminal
npm install -g @google/gemini-cli
gemini --version
3

获取 API 令牌

Get API Token

访问 kyAPI 令牌管理,创建 geminiautoall 分组令牌。

Visit kyAPI Token Management, create a gemini, auto, or all group token.

4

创建配置文件

Create Config Files

配置位置:Config location: ~/.gemini/

Terminal
# 创建配置目录 / Create config directory
mkdir -p ~/.gemini

# 创建 .env 文件 / Create .env file
cat > ~/.gemini/.env << 'EOF'
GOOGLE_GEMINI_BASE_URL=https://api.haiyawl.com
GEMINI_API_KEY=sk-xxxxxxxxxxxxxxxx
GEMINI_MODEL=gemini-2.5-pro
EOF

# 创建 settings.json 文件 / Create settings.json file
cat > ~/.gemini/settings.json << 'EOF'
{
  "ide": {
    "enabled": true
  },
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  }
}
EOF

⚠️ 编辑 .env 文件,替换令牌:nano ~/.gemini/.env ⚠️ Edit .env file, replace token: nano ~/.gemini/.env

5

启动 Gemini CLI

Launch Gemini CLI

Terminal
gemini
📋 系统要求📋 System Requirements
  • Linux (Ubuntu 18.04+, CentOS 7+, Debian 9+)
  • Node.js 18+
  • 网络连接Network connection
1

安装 Node.js

Install Node.js

请参考 Claude Code 部分的 Linux 安装说明。

Refer to Linux installation in Claude Code section.

2

安装 Gemini CLI

Install Gemini CLI

Terminal
npm install -g @google/gemini-cli
gemini --version
3

获取令牌 & 创建配置

Get Token & Create Config

访问 kyAPI 令牌管理 获取令牌,然后创建配置:

Visit kyAPI Token Management to get token, then create config:

Terminal
# 创建配置目录 / Create config directory
mkdir -p ~/.gemini

# 创建 .env 文件 / Create .env file
cat > ~/.gemini/.env << 'EOF'
GOOGLE_GEMINI_BASE_URL=https://api.haiyawl.com
GEMINI_API_KEY=sk-xxxxxxxxxxxxxxxx
GEMINI_MODEL=gemini-2.5-pro
EOF

# 创建 settings.json 文件 / Create settings.json file
cat > ~/.gemini/settings.json << 'EOF'
{
  "ide": {
    "enabled": true
  },
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  }
}
EOF

⚠️ 编辑 .env 文件,替换令牌:nano ~/.gemini/.env ⚠️ Edit .env file, replace token: nano ~/.gemini/.env

4

启动 Gemini CLI

Launch Gemini CLI

Terminal
gemini

📋 CLI 配置速查表

📋 CLI Configuration Quick Reference

配置文件路径

Config File Paths

工具Tool Windows 路径Windows Path macOS / Linux 路径Path
Claude Code %USERPROFILE%\.claude\settings.json ~/.claude/settings.json
CodeX %USERPROFILE%\.codex\config.toml
%USERPROFILE%\.codex\auth.json
~/.codex/config.toml
~/.codex/auth.json
Gemini CLI %USERPROFILE%\.gemini\.env
%USERPROFILE%\.gemini\settings.json
~/.gemini/.env
~/.gemini/settings.json

分组与 API 地址对照

Group & API URL Reference

CLI 工具CLI Tool 推荐分组Recommended Group API 地址API URL
Claude Code claudecodecheap / claudecode (工程engineering) https://api.haiyawl.com
CodeX azureopenai / auto / all https://api.haiyawl.com/v1
Gemini CLI gemini / auto / all https://api.haiyawl.com

📱 移动端 APP 接入指南

📱 Mobile App Integration Guide

RikkaHUB

功能强大的 AI 聊天应用,支持多种 AI 模型(仅限 Android)

Powerful AI chat app supporting multiple AI models (Android only)

1

下载安装

Download & Install

从官网下载 RikkaHUB:

Download RikkaHUB from official website:

2

配置 API

Configure API

  1. 打开 RikkaHUB,进入「设置」
  2. 选择「API 配置」或「服务商设置」
  3. 选择「自定义 API」或「OpenAI 兼容」
  4. 填入以下配置:
  1. Open RikkaHUB, go to "Settings"
  2. Select "API Configuration" or "Provider Settings"
  3. Select "Custom API" or "OpenAI Compatible"
  4. Enter the following configuration:
API URL: https://api.haiyawl.com/v1
API Key: sk-xxxxxxxxxxxxxxxx

⚠️ 将 API Key 替换为您的 autoall 分组令牌 ⚠️ Replace API Key with your auto or all group token

3

选择模型

Select Model

在模型选择中输入或选择您想使用的模型,如:

Enter or select the model you want to use, such as:

  • claude-sonnet-4-20250514
  • gpt-4o
  • gemini-2.5-pro

Tavo

简洁优雅的 AI 助手应用(支持 Android / iOS)

Simple and elegant AI assistant app (Android / iOS)

1

下载安装

Download & Install

从官网下载 Tavo:

Download Tavo from official website:

2

配置 API

Configure API

  1. 打开 Tavo,进入设置页面
  2. 选择「API 设置」
  3. 选择「OpenAI 兼容」模式
  4. 填入配置信息:
  1. Open Tavo, go to Settings
  2. Select "API Settings"
  3. Select "OpenAI Compatible" mode
  4. Enter configuration:
API URL: https://api.haiyawl.com/v1
API Key: sk-xxxxxxxxxxxxxxxx

Chatbox

跨平台 AI 聊天客户端,支持 Windows / macOS / Linux / iOS / Android

Cross-platform AI chat client supporting Windows / macOS / Linux / iOS / Android

1

下载安装

Download & Install

访问官网下载对应平台的 Chatbox:

Visit official website to download Chatbox for your platform:

2

配置 API

Configure API

  1. 打开 Chatbox,点击左下角设置图标
  2. 选择「AI 模型设置」
  3. 选择「OpenAI API」
  4. 填入以下配置:
  1. Open Chatbox, click settings icon at bottom left
  2. Select "AI Model Settings"
  3. Select "OpenAI API"
  4. Enter the following configuration:
API Host: https://api.haiyawl.com
API Key: sk-xxxxxxxxxxxxxxxx
Model: claude-sonnet-4-20250514

OMate

智能 AI 助手应用(支持 Android / iOS)

Smart AI assistant app (Android / iOS)

1

下载安装

Download & Install

从官网下载 OMate:

Download OMate from official website:

2

配置 API

Configure API

  1. 打开 OMate,进入设置
  2. 选择「API 配置」
  3. 选择「自定义 API」
  4. 填入配置信息
  1. Open OMate, go to Settings
  2. Select "API Configuration"
  3. Select "Custom API"
  4. Enter configuration
API URL: https://api.haiyawl.com/v1
API Key: sk-xxxxxxxxxxxxxxxx

💻 桌面端 & 网页端接入指南

💻 Desktop & Web Integration Guide

Cherry Studio

功能丰富的桌面端 AI 助手,支持 Windows / macOS / Linux

Feature-rich desktop AI assistant supporting Windows / macOS / Linux

1

下载安装

Download & Install

访问官网或 GitHub 下载 Cherry Studio:

Visit official website or GitHub to download Cherry Studio:

2

配置 API

Configure API

  1. 打开 Cherry Studio
  2. 点击左下角「设置」图标
  3. 进入「模型服务商」设置
  4. 点击「添加」,选择「OpenAI」
  5. 填入以下配置:
  1. Open Cherry Studio
  2. Click "Settings" icon at bottom left
  3. Go to "Model Providers" settings
  4. Click "Add", select "OpenAI"
  5. Enter the following configuration:
API URL: https://api.haiyawl.com
API Key: sk-xxxxxxxxxxxxxxxx
3

添加模型

Add Models

在「模型列表」中添加您想使用的模型:

Add models you want to use in "Model List":

  • claude-sonnet-4-20250514 (Claude Sonnet 4)
  • claude-opus-4-20250514 (Claude Opus 4)
  • gpt-4o (GPT-4o)
  • gemini-2.5-pro (Gemini 2.5 Pro)

SillyTavern (酒馆Tavern)

强大的故事创作平台(支持 OpenAI / Claude)

Powerful story creation platform (OpenAI / Claude supported)

⚠️ 分组选择(重要) ⚠️ Group Selection (Important)

SillyTavern 支持 OpenAI(自定义)与 Claude(Claude / Anthropic Native)等接口类型。 SillyTavern supports OpenAI (Custom) and Claude (Claude / Anthropic Native).

1

安装 SillyTavern

Install SillyTavern

从 GitHub 下载并安装 SillyTavern:

Download and install SillyTavern from GitHub:

安装完成后,运行 start.bat (Windows) 或 start.sh (macOS/Linux) 启动。

After installation, run start.bat (Windows) or start.sh (macOS/Linux) to start.

2

配置 API

Configure API

  1. 打开浏览器访问 http://localhost:8000
  2. 点击顶部「API」按钮
  3. 选择「Claude」(或「Anthropic / Claude (Native)」)
  4. 填入以下配置:
  1. Open browser and visit http://localhost:8000
  2. Click "API" button at top
  3. Select "Claude" (or "Anthropic / Claude (Native)")
  4. Enter the following configuration:
Claude API URL: https://api.haiyawl.com/v1
API Key: sk-xxxxxxxxxxxxxxxx
3

选择模型

Select Model

点击「模型价格」链接选择合适模型,并将模型名称填入模型列表。

Open "Model Pricing" to pick a model, then paste the model name into the model list.

4

解决 400 错误

Fix 400 Error

如果遇到 400 Bad Request 错误,请在「AI Response Configuration」中将 Top_P 设置为 0

If you encounter 400 Bad Request error, set Top_P to 0 in "AI Response Configuration".

❓ 常见问题

❓ Frequently Asked Questions

AWS Claude 返回 400 错误

AWS Claude Returns 400 Error

问题描述:使用 AWS Claude 渠道时,API 返回 400 Bad Request 错误。

Problem: When using AWS Claude channel, API returns 400 Bad Request error.

解决方案:

Solution:

在请求参数中将 Top_P 设置为 0,或在应用设置中调整此参数。 Set Top_P to 0 in request parameters, or adjust this setting in your application.

适用场景:SillyTavern、Cherry Studio 等需要调用 Claude 模型的应用。

Applies to: SillyTavern, Cherry Studio, and other applications calling Claude models.

Claude Code 上下文耗尽

Claude Code Context Exhausted

问题描述:Claude Code 提示上下文窗口已满,无法继续对话。

Problem: Claude Code shows context window is full, cannot continue conversation.

解决方案:

Solution:

Claude Code
/clear

在 Claude Code 中输入 /clear 命令清除当前上下文,然后重新开始对话。

Enter /clear command in Claude Code to clear current context, then start a new conversation.

💡 提示:建议在处理大型项目时,合理规划对话内容,避免单次对话过长。 💡 Tip: When working on large projects, plan your conversation content wisely to avoid overly long single conversations.

令牌复制不完整

Token Copy Incomplete

问题描述:点击复制按钮后,令牌没有完整复制。

Problem: After clicking copy button, token is not fully copied.

解决方案:

Solution:

  1. 点击令牌旁的「小眼睛」图标显示完整令牌
  2. 手动选中并复制完整令牌(格式为 sk-xxxxxxxxxxxxxxxx
  3. 确保令牌以 sk- 开头
  1. Click the "eye" icon next to the token to reveal the full token
  2. Manually select and copy the complete token (format: sk-xxxxxxxxxxxxxxxx)
  3. Ensure the token starts with sk-

无法访问 kyAPI 网站

Cannot Access kyAPI Website

问题描述:网页打不开或加载很慢。

Problem: Website won't open or loads very slowly.

解决方案:

Solution:

  • 使用系统自带浏览器(Chrome、Edge、Safari)
  • 避免使用 UC、夸克、百度、QQ 等带审核机制的浏览器
  • 推荐使用 VIA 浏览器(轻量、无广告)
  • 尝试备用域名:api.haiyawl.com
  • Use system browsers (Chrome, Edge, Safari)
  • Avoid using browsers with built-in censorship like UC, Quark, Baidu, QQ
  • Recommend VIA Browser (lightweight, ad-free)
  • Try alternative domain: api.haiyawl.com

充值后余额未显示

Balance Not Shown After Payment

问题描述:支付成功后,余额没有立即更新。

Problem: After successful payment, balance is not immediately updated.

解决方案:

Solution:

  1. 余额可能有延迟显示,但已可正常使用
  2. 前往「使用日志」查看充值记录确认到账
  3. 如因网络问题导致未到账,请联系首页在线客服
  1. Balance display may be delayed, but credits are already usable
  2. Check "Usage Logs" to confirm payment arrival
  3. If payment didn't arrive due to network issues, contact online customer service

Node.js 安装失败

Node.js Installation Failed

问题描述:无法安装 Node.js 或 npm 命令无法识别。

Problem: Cannot install Node.js or npm command not recognized.

解决方案:

Solution:

  • Windows:重启命令行窗口,或重新安装 Node.js
  • macOS:使用 brew install node 重新安装
  • Linux:使用 NodeSource 官方脚本安装
  • 确保安装 LTS 版本而非最新版
  • Windows: Restart terminal window, or reinstall Node.js
  • macOS: Reinstall using brew install node
  • Linux: Use NodeSource official script to install
  • Ensure you install the LTS version, not latest

API 请求超时

API Request Timeout

问题描述:请求 API 时超时或响应很慢。

Problem: API requests timeout or respond very slowly.

解决方案:

Solution:

  • 尝试使用不同节点(日本节点 jp.api.haiyawl.com 或香港节点 hk.api.haiyawl.com
  • 在配置中增加超时时间(如 API_TIMEOUT_MS: 600000
  • 检查网络连接是否稳定
  • Try different nodes (Japan jp.api.haiyawl.com or Hong Kong hk.api.haiyawl.com)
  • Increase timeout in configuration (e.g., API_TIMEOUT_MS: 600000)
  • Check if your network connection is stable