Set up HaryAI in your tools
Pick your tool, then one of three ways. It takes a few minutes.
CC Switch is a free app that switches your tools between providers. Install it from its GitHub releases page.
Codex
1One click with CC Switch
- On your account page, press Show next to your key, then Import for Codex.
- CC Switch opens. Confirm, switch Codex to HaryAI, and restart Codex.
Check: Quit Codex completely, reopen it and send a short message. A reply means you're set.
2Ask an AI to do it
Send this to Codex or Claude Code (or whatever AI assistant you use). Put your key in place of <your HaryAI key> first.
Set up Codex on this computer to use HaryAI.
1. Back up ~/.codex/config.toml (copy it to ~/.codex/config.toml.bak). If it doesn't exist, create it.
2. Add these settings. If a setting with the same name is already there, change its value. Leave everything else as it is.
```toml
model = "deepseek-flash"
model_provider = "haryai"
forced_login_method = "api"
model_reasoning_effort = "high"
[model_providers.haryai]
name = "HaryAI"
base_url = "https://api.haryai.com/v1"
wire_api = "responses"
experimental_bearer_token = "<your HaryAI key>"
```
3. Then tell me to quit Codex completely, reopen it, and send a short message to check that it answers.
4. Also tell me how to undo this: put the backup back and reopen Codex.Check: Quit Codex completely, reopen it and send a short message. A reply means you're set.
3By hand
Add this to ~/.codex/config.toml, with your key in place of <your HaryAI key>. The same file covers the Codex CLI, Codex in the ChatGPT desktop app, and the VS Code extension.
model = "deepseek-flash"
model_provider = "haryai"
forced_login_method = "api"
model_reasoning_effort = "high"
[model_providers.haryai]
name = "HaryAI"
base_url = "https://api.haryai.com/v1"
wire_api = "responses"
experimental_bearer_token = "<your HaryAI key>"If you signed in to Codex with ChatGPT, this switches it to your HaryAI key. Your earlier ChatGPT sessions are kept.
Check: Quit Codex completely, reopen it and send a short message. A reply means you're set.
Claude Code
1One click with CC Switch
- On your account page, press Show next to your key, then Import for Claude Code.
- CC Switch opens. Confirm, switch Claude Code to HaryAI, and restart Claude Code.
Check: Start a new Claude Code session and send a short message. A reply means you're set.
2Ask an AI to do it
Send this to Codex or Claude Code (or whatever AI assistant you use). Put your key in place of <your HaryAI key> first.
Set up Claude Code on this computer to use HaryAI.
1. Back up ~/.claude/settings.json (copy it to ~/.claude/settings.json.bak). If it doesn't exist, create it containing {}.
2. Add the entries below to the "env" object in that file. If an entry with the same name is already there, change its value. Keep every other setting, and keep the file valid JSON.
```json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.haryai.com",
"ANTHROPIC_AUTH_TOKEN": "<your HaryAI key>",
"ANTHROPIC_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-flash",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-flash",
"CLAUDE_CODE_EFFORT_LEVEL": "max",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "786432",
"CLAUDE_CODE_DISABLE_ARTIFACT": "1"
}
}
```
3. Then tell me to start a new Claude Code session and send a short message to check that it answers.
4. Also tell me how to undo this: put the backup back and start a new session.Check: Start a new Claude Code session and send a short message. A reply means you're set.
3By hand
Add this to ~/.claude/settings.json, with your key in place of <your HaryAI key>. If the file already has an "env" block, add these entries to it. This covers the Claude Code CLI and the VS Code extension.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.haryai.com",
"ANTHROPIC_AUTH_TOKEN": "<your HaryAI key>",
"ANTHROPIC_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-flash[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-flash",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-flash",
"CLAUDE_CODE_EFFORT_LEVEL": "max",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "786432",
"CLAUDE_CODE_DISABLE_ARTIFACT": "1"
}
}Check: Start a new Claude Code session and send a short message. A reply means you're set.
Claude Desktop
Claude Desktop is set up with CC Switch.
1One click with CC Switch
- On your account page, press Show next to your key, then Import for Claude Desktop.
- CC Switch opens. Confirm, switch Claude Desktop to HaryAI, and restart Claude Desktop.
Check: Restart Claude Desktop and start a new chat. A reply means you're set.
If something's off
- 401 or “invalid key”
- The key was copied wrong. On your account page, press Show and copy it again.
- “Insufficient quota” or 额度不足
- Your Coding Plan and balance are used up. Top up or get a Coding Plan, and the next request works.
- No reply after setup
- Quit the tool completely and open it again.