Skip to main content

Use Claude Code with Claude API Key in 5 Minutes: A Beginner-Friendly CC Switch Setup Guide

**Step-by-step guide to connecting ClaudeAPI.com with CC Switch: skip manual config edits, switch Claude API providers with one click, and get download links for every platform.**

Getting StartedCC SwitchClaudeAPIEst. read10min
2026.05.13 published
Use Claude Code with Claude API Key in 5 Minutes: A Beginner-Friendly CC Switch Setup Guide

Use Claude Code with Claude API Key in 5 Minutes: A Beginner-Friendly CC Switch Setup Guide

If you are getting started with Claude Code and want to connect it to ClaudeAPI.com without manually editing config files, this guide is for you.

CC Switch is a desktop configuration manager for AI coding tools. Instead of hunting down settings.json, memorizing environment variables, or maintaining multiple provider configs by hand, you can add your API key in a visual interface and switch providers with one click.

In this walkthrough, you will set up ClaudeAPI.com in CC Switch, activate it for Claude Code, and verify that your CLI is using the correct model.


What Is CC Switch?

CC Switch is a cross-platform desktop app for managing API configurations across AI coding tools such as Claude Code, Codex, and Gemini CLI.

Instead of editing JSON or TOML files manually, CC Switch gives you a provider-based interface where you can configure API endpoints, tokens, model mappings, and MCP settings in one place.

In practical terms:

Open CC Switch, add your ClaudeAPI.com API key, set the base URL, click Activate, and Claude Code is ready to use.

Key Features

Feature Why it matters
Visual provider management Configure API providers through forms instead of editing config files manually.
One-click switching Switch between providers from the tray menu without rebuilding your setup.
Built-in presets Start from common API provider presets instead of configuring everything from scratch.
MCP management Keep MCP server settings synchronized across supported tools.
Connection testing Check latency and verify whether a provider is reachable before using it.
Cloud sync Sync settings through Dropbox, OneDrive, iCloud, or WebDAV when needed.

Before You Start: Install Claude Code

CC Switch manages configuration for Claude Code, so Claude Code needs to be installed first.

Windows PowerShell

irm https://claude.ai/install.ps1 | iex
irm https://claude.ai/install.ps1 | iex

macOS or Linux

curl -fsSL https://claude.ai/install.sh | bash
curl -fsSL https://claude.ai/install.sh | bash

After installation, verify that Claude Code is available:

claude --version
claude --version

If the command returns a version number, Claude Code is installed correctly.

Prefer a GUI workflow? You can also install the Claude Code desktop app, available for Windows and macOS.


Step 1: Create a ClaudeAPI.com Account and Get an API Key

  1. Go to ClaudeAPI.com and create an account.
  2. Verify your email address and open the dashboard.

  1. Open the API Keys page and click Create New Key.

  1. Copy your API key and save it immediately. It will only be displayed once.

Available ClaudeAPI.com Model Examples

Model Model ID Input price Recommended use case
Claude Opus 4.7 claude-opus-4-7 $4.000 / 1M tokens Complex reasoning, architecture review, long-context tasks
Claude Opus 4.6 claude-opus-4-6 $4.000 / 1M tokens Complex reasoning and advanced development workflows
Claude Sonnet 4.6 claude-sonnet-4-6 $2.400 / 1M tokens Everyday coding, refactoring, debugging, and general development
Claude Haiku 4.5 claude-haiku-4-5-20251001 $0.800 / 1M tokens Lightweight tasks, batch jobs, and fast responses

For most developers, Claude Sonnet 4.6 is a good default choice for daily coding work.


Step 2: Download and Install CC Switch

GitHub repository: github.com/farion1231/cc-switch Official website: ccswitch.io Releases page: github.com/farion1231/cc-switch/releases

Windows

File Description
CC-Switch-v{version}-Windows.msi Recommended installer with auto-update support.
CC-Switch-v{version}-Windows-Portable.zip Portable version. Extract and run without modifying the registry.

Requirement: Windows 10 or later, x64.

macOS

Option 1: Install with Homebrew

brew tap farion1231/ccswitch
brew install --cask cc-switch
brew tap farion1231/ccswitch
brew install --cask cc-switch

Option 2: Download Manually

File Description
CC-Switch-v{version}-macOS.dmg Recommended. Drag the app into Applications.
CC-Switch-v{version}-macOS.zip ZIP archive version.

Requirement: macOS 12 Monterey or later.

CC Switch for macOS is code-signed and notarized, so it should open without additional security workarounds.

Linux

Distribution Recommended package Install command
Ubuntu / Debian .deb sudo apt install ./CC-Switch-*.deb
Fedora / RHEL .rpm sudo dnf install ./CC-Switch-*.rpm
Arch Linux .AppImage chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage
Other distributions .AppImage Same as above.

Step 3: Add ClaudeAPI.com as a Provider in CC Switch

Open CC Switch after installation and create a new provider for ClaudeAPI.com.

Fill in the provider configuration.

Use the following values:

Field Value
Provider name ClaudeAPI
API base URL https://gw.claudeapi.com
API key / token Your ClaudeAPI.com API key

Then configure the model mapping.

Recommended model mapping:

Field Recommended value
Default main model claude-sonnet-4-6
Default Opus model claude-opus-4-7
Default Sonnet model claude-sonnet-4-6
Default Haiku model claude-haiku-4-5-20251001

Click Save when you are done.


Step 4: Activate the Provider and Test the Connection

Activate ClaudeAPI.com

In the provider list, find the provider you just created and click Activate or Enable.

CC Switch will write the required Claude Code configuration automatically, including:

ANTHROPIC_BASE_URL
ANTHROPIC_AUTH_TOKEN
ANTHROPIC_BASE_URL
ANTHROPIC_AUTH_TOKEN

That means you do not need to manually edit ~/.claude/settings.json.

Test the Provider

CC Switch includes a built-in connection test.

  1. Click Test next to the provider.
  2. Wait for the latency check to complete.
  3. A green status indicator means the provider is reachable.

Verify Claude Code

Open a terminal and run:

claude
claude

If Claude Code starts normally and responds, your setup is working.

You can also check the active model inside Claude Code:

/model
/model

This opens the model selection menu so you can confirm which model is currently active.


Step 5: Use CC Switch in Your Daily Workflow

Switch Providers from the System Tray

After installation, CC Switch runs in the system tray. If you use multiple providers — for example, ClaudeAPI.com for day-to-day development and another provider for testing — you can right-click the tray icon and switch providers without opening the main app.

Change Models Inside Claude Code

Inside a Claude Code session, run:

/model
/model

This opens an interactive model picker, so you can switch models without restarting your entire workflow.

Create Multiple Providers for Different Workloads

A common setup is to create several ClaudeAPI.com providers with different default models:

Provider name Suggested use case
ClaudeAPI-Sonnet Daily coding, debugging, refactoring, and general development.
ClaudeAPI-Opus Complex reasoning, architecture reviews, and high-stakes analysis.
ClaudeAPI-Haiku Fast, lightweight, or batch-style tasks.

The configuration process is the same. The only difference is the default model you choose in the model mapping section.


Troubleshooting

Claude Code does not use the new provider after switching. What should I do?

Restart your terminal, or exit Claude Code with:

/exit
/exit

Then run claude again.

If you are using CC Switch’s local proxy mode, hot switching may work without restarting the terminal.

What happens if ANTHROPIC_BASE_URL is incorrect?

Claude Code may return a 401 error or a connection error.

Make sure the base URL is:

https://gw.claudeapi.com
https://gw.claudeapi.com

Note the gw subdomain. Do not use api here.

I forgot to save my API key. Can I view it again?

No. For security reasons, the API key is only shown once.

Go back to the ClaudeAPI.com dashboard, create a new API key, and revoke the old one if needed.

Does CC Switch upload or store my API key on its own servers?

CC Switch stores data locally in a SQLite database:

~/.cc-switch/cc-switch.db
~/.cc-switch/cc-switch.db

It does not upload your API key to CC Switch servers.

If you enable cloud sync, your configuration is synced through the storage provider you choose, such as Dropbox, OneDrive, iCloud, or WebDAV. In that case, your keys are stored in your own sync destination, not by CC Switch itself.


Final Workflow

After setup, your development workflow looks like this:

  1. ClaudeAPI.com provides model access and API credits.
  2. CC Switch manages provider configuration and model mapping.
  3. Claude Code runs as your AI coding assistant in the terminal or desktop app.

The whole setup takes only a few minutes. Once configured, you can switch between providers and models without manually editing config files, which makes Claude Code much easier to use across different development scenarios.


Need Help?

If you run into issues during setup, you can visit ClaudeAPI.com for support or check the Issues page in the official CC Switch GitHub repository.

Related Articles