Help
Setup guide: connect Claude Code and Codex to HaryAI
Three ways to connect: the HaryAI app, CC Switch, or editing the config yourself. All three use the same address and the same key, so pick whichever suits you.
Address and key
| Tool | Base URL | Key |
|---|---|---|
| Claude Code | https://api.xiaohongqiao.cn | Your Claude key |
| Codex | https://api.xiaohongqiao.cn/v1 | Your Codex key |
Your keys are in My account. Claude and Codex each have their own key, and they aren't interchangeable. If you were given an activation code, that code is the key.
Use one method only. Two at once overwrite each other.
Option 1: the HaryAI app (recommended)
- Download and install the app, for macOS or Windows. Download
- Sign in with your HaryAI account and the keys are set up for you. No account? Paste a key instead.
- Turn on the Claude Code or Codex switch.
- Restart your terminal or the Codex app.
No addresses or keys to type. Turn a switch off and your previous config comes back exactly as it was, and Codex keeps one conversation history.
Option 2: CC Switch
Already managing providers in CC Switch? Add a custom provider. Field names follow CC Switch's English UI.
Claude Code
- Select Claude at the top and click + in the top-right corner.
- Choose Custom and name the provider HaryAI.
- Set API Endpoint to https://api.xiaohongqiao.cn and API Key to your Claude key.
- Click Add, enable HaryAI in the list, then restart Claude Code.
Codex
- Select Codex at the top and click + in the top-right corner.
- Choose Custom and name the provider HaryAI.
- Set API Request URL to https://api.xiaohongqiao.cn/v1 and API Key to your Codex key.
- Set Upstream Format to Responses (native) and Model Name to gpt-5.6-sol.
- Click Add, enable HaryAI in the list, then restart Codex.
Option 3: edit the config yourself
Prefer not to install anything? Edit Claude Code's and Codex's own config files. Back them up first.
Claude Code · ~/.claude/settings.json
Add this env block to settings.json, merging it with whatever settings are already there:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.xiaohongqiao.cn",
"ANTHROPIC_AUTH_TOKEN": "your Claude key"
}
}Codex · ~/.codex/config.toml
Add these lines at the top of config.toml (if model or model_provider is already set, replace it with the value below):
model = "gpt-5.6-sol" model_provider = "haryai" [model_providers.haryai] name = "HaryAI" base_url = "https://api.xiaohongqiao.cn/v1" wire_api = "responses" env_key = "HARYAI_API_KEY"
Then put your Codex key in the HARYAI_API_KEY environment variable and restart your terminal:
# macOS / Linux echo 'export HARYAI_API_KEY="your Codex key"' >> ~/.zshrc # Windows (PowerShell) setx HARYAI_API_KEY "your Codex key"
On Windows these files live in %USERPROFILE%\.claude and %USERPROFILE%\.codex. To go back to your official account, remove the lines you added.
Which models you can use
The model list changes as upstream supply changes. Check the current list with your key:
curl https://api.xiaohongqiao.cn/v1/models -H "Authorization: Bearer your key"
Other tools
Tools that take a custom endpoint, such as Cline or Cursor, work too: for the Anthropic API, use the root address and your Claude key; for the OpenAI Responses API, use the /v1 address and your Codex key.