Claude Code Setup

Configure Claude Code to use the platform as a custom API provider.

Prerequisites

  • Node.js 18 or later installed.
  • An API key from the platform ( get one here). Use a General key type for Claude models.
  • Claude Code installed via npm: npm install -g @anthropic-ai/claude-code

Option A: CC-Switch (Recommended)

CC-Switch is a community tool that simplifies switching Claude Code to a custom provider.

  1. Install CC-Switch:
    npm install -g cc-switch
  2. Run the switch command:
    cc-switch --base-url http://localhost:3000/api/v1
  3. Set your API key as an environment variable:
    export ANTHROPIC_API_KEY=sk-YOUR_KEY_HERE
  4. Run claude in your terminal and start chatting.

Option B: Manual Configuration

Claude Code stores provider settings in ~/.claude.json. You can edit this file directly.

  1. Create or edit ~/.claude.json:
    {
      "apiKey": "sk-YOUR_KEY_HERE",
      "baseURL": "http://localhost:3000/api/v1"
    }
  2. Set the required environment variable so Claude Code recognizes the key:
    export ANTHROPIC_API_KEY=sk-YOUR_KEY_HERE
  3. Restart your terminal and run claude.

Troubleshooting

  • First-run error: On the very first launch, Claude Code may attempt to contact api.anthropic.com before reading your config. Simply press Ctrl+C to skip, then re-run — it will use your custom base URL on subsequent launches.
  • 401 Unauthorized: Double-check that ANTHROPIC_API_KEY is set and your key is valid.
  • Model not found: Ensure you are using a General key type and the model name matches exactly (e.g., claude-sonnet-4-20250514).

Need help?

Contact us on WhatsApp for setup assistance.