Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ruapi.ai/llms.txt

Use this file to discover all available pages before exploring further.

CC Switch is a cross-platform desktop app that manages configurations for Claude Code, Codex, Gemini CLI, OpenCode, and OpenClaw. One GUI to switch all of them between providers — no need to hand-edit ~/.claude/settings.json, ~/.codex/config.toml, or ~/.openclaw/openclaw.json.
If you only use one CLI (say, Claude Code), you can skip CC Switch and follow Claude Code direct setup. CC Switch shines when you juggle multiple tools and multiple providers.

Prerequisites

1

Sign up and top up

Create an account at www.ruapi.ai and top up with USDT. See the top-up guide.
2

Create an API key

Console → TokensCreate token. Copy the sk-... string. Details in API keys & security.
3

Install at least one CLI

CC Switch doesn’t install Claude Code / Codex / etc. — it only manages their configs. Install your CLI first via Claude Code or Codex.

Install CC Switch

Grab a build from the Releases page:
Download cc-switch-x.y.z-arm64.dmg (Apple Silicon) or cc-switch-x.y.z-x64.dmg (Intel) → double-click to mount → drag CC Switch.app into Applications.
If you see “cannot verify developer” on first launch, go to System Settings → Privacy & Security, scroll down, and click Open Anyway.

Add RuAPI to CC Switch (Claude Code)

Open CC Switch, select the Claude Code tab on the left:
1

Click 'Add Provider'

The + Add Provider button is at the top-right of the main window.
2

Choose 'Custom Provider'

Scroll to the bottom of the preset list and pick Custom Provider. If “RuAPI” already shows up as a preset, pick it directly — only the API key needs filling in.
3

Basic info

FieldValue
NameRuAPI
Websitehttps://www.ruapi.ai
IconOptional, leave blank for default
4

Environment variables

Switch to the Environment Variables (or Endpoint config) tab:
VariableValue
ANTHROPIC_BASE_URLhttps://www.ruapi.ai
ANTHROPIC_API_KEYsk-your-RuAPI-token
ANTHROPIC_MODEL (optional)claude-sonnet-4-6
ANTHROPIC_SMALL_FAST_MODEL (optional)claude-haiku-4-5
Do not append /v1 to ANTHROPIC_BASE_URL. The Anthropic SDK adds /v1/messages automatically — an extra /v1 causes 404s.
5

Save and enable

Click Save → back on the main screen, click Enable on the RuAPI row. Green status = Claude Code is now routed through RuAPI.

Add RuAPI to CC Switch (Codex)

Switch to the Codex tab on the left and repeat the add flow, but use these env vars:
VariableValue
OPENAI_BASE_URLhttps://www.ruapi.ai/v1
OPENAI_API_KEYsk-your-key (same token works)
OPENAI_MODEL (optional)gpt-5 or whichever default you want
Codex uses the OpenAI-compatible protocol, so OPENAI_BASE_URL must end in /v1.

Verify the switch

After switching in CC Switch, behavior differs per tool:

Claude Code

No restart needed — CC Switch hot-swaps. Just keep typing in your open claude session.

Codex / OpenClaw / Gemini CLI

Close and reopen the terminal (or restart the CLI) so the new env vars are picked up.
A quick smoke test:
# Claude Code
claude "In one sentence, which API are you using?"

# Codex
codex "In one sentence, which API are you using?"
A normal reply with no 401 / network error = success.

Switch back to the official provider

In CC Switch’s main UI, pick another provider → click Enable. CC Switch rewrites the relevant config files.
You can keep RuAPI, the official Anthropic/OpenAI account, and other relays all listed at the same time and switch with one click. That’s CC Switch’s main payoff.

Troubleshooting

  1. Close the current claude session and open a fresh terminal.
  2. Check whether you manually exported ANTHROPIC_BASE_URL anywhere — shell-level env vars override the settings file CC Switch writes.
  3. Run cat ~/.claude/settings.json and confirm the env block contains RuAPI’s config.
  • Verify ANTHROPIC_API_KEY was copied completely (the sk- prefix and every trailing character).
  • In the RuAPI Console → Tokens, confirm the key is enabled and that the “allowed models” allowlist (if any) includes the model you’re using.
  • Check your USD balance.
  • Typo in the model ID. Common Claude IDs on RuAPI: claude-sonnet-4-6, claude-opus-4-7, claude-haiku-4-5.
  • Don’t append /v1 to ANTHROPIC_BASE_URL.
Make sure Claude Code has been run at least once (so ~/.claude/settings.json exists). With Claude Code not installed, CC Switch has nothing to switch.

Next steps