⚡ CheapClaude
Home Cursor Guide Get API Key →
🔧 Claude Code + API Key Guide

Claude Code API Key:
Setup Guide + Save 64%

How to use your own API Key in Claude Code (Anthropic's terminal AI). Step-by-step setup for Mac, Linux, and WSL — plus how to pay $36 instead of $100.

Published April 2026 · 6 min read

Claude Code is Anthropic's agentic coding tool that runs directly in your terminal. It can edit files, run commands, search code, and manage entire projects autonomously. But using it with Anthropic's direct API pricing gets expensive fast — especially for teams.

This guide covers:

  1. How to set up a custom Claude API Key in Claude Code
  2. How to get that API Key at 64% off official pricing
  3. Best practices for team usage

🔧 Need a Claude Code API Key?

CC Official channel — optimized specifically for Claude Code. $36 per $100 tokens.

Get Your API Key →

Setup in 5 minutes · No minimum · Unused balance refundable

Step 1: Install Claude Code

Claude Code requires Node.js 18+ and runs on macOS, Linux, and Windows (WSL).

1

Install via npm

Run this in your terminal:

npm install -g @anthropic-ai/claude-code
2

Verify installation

Check that Claude Code is installed correctly:

claude --version

Step 2: Configure Your API Key

By default, Claude Code uses Anthropic's official API. To use a third-party provider (like CheapClaude), set two environment variables:

For Bash/Zsh (Mac/Linux)

# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
export ANTHROPIC_API_KEY="sk-your-cheapclaude-key"
export ANTHROPIC_BASE_URL="https://your-agent.cc/api"

# Reload your shell
source ~/.zshrc

For Fish Shell

set -Ux ANTHROPIC_API_KEY "sk-your-cheapclaude-key"
set -Ux ANTHROPIC_BASE_URL "https://your-agent.cc/api"

For Windows (WSL)

# Add to ~/.bashrc
export ANTHROPIC_API_KEY="sk-your-cheapclaude-key"
export ANTHROPIC_BASE_URL="https://your-agent.cc/api"
3

Launch Claude Code

Navigate to your project and run:

cd ~/your-project
claude

Claude Code will automatically use your custom API key. You'll see it connect and start accepting commands.

Step 3: Save 64% on Claude Code

Claude Code consumes tokens fast — a single complex task can use 50K+ tokens. Here's what it costs:

Anthropic Direct
$100
per 50M tokens
CC Official Channel
$36
same tokens · Save 64%

The CC Official channel is specifically optimized for Claude Code and Cursor — stable connections, consistent low latency, and reliable streaming.

Why CC Official for Claude Code?

FeatureAnthropic DirectCC Official ($36)
Price / $100$100$36 (save 64%)
Streaming✓ Optimized
LatencyStandardLow (coding-optimized)
Long sessionsMay timeoutStable connections
Unused balanceNon-refundableRefundable

💡 Pro tip: For dev/testing, use the Hybrid channel ($15) instead. Switch to CC Official for production work. Same API key, just request a channel change. See all 4 channels →

For Teams: Multi-Key Setup

If your team has 3-20 developers all using Claude Code:

Team cost comparison

Team SizeAnthropic DirectCheapClaude CC OfficialMonthly Savings
3 developers~$300/mo~$108/mo$192/mo
5 developers~$500/mo~$180/mo$320/mo
10 developers~$1,000/mo~$360/mo$640/mo

🏢 Running a team with Claude Code?

Multi-key management + usage dashboard. Save 64% per developer.

Get Team API Keys →

🌏 Telegram @zhoumo_828 · 🇨🇳 WeChat: Moumlbius · ⏱️ Response in 30 min

Troubleshooting

Claude Code says "API key not found"

Make sure your environment variable is set correctly. Run echo $ANTHROPIC_API_KEY — it should show your key. If blank, add it to your shell config and run source ~/.zshrc.

Connection timeout errors

If you're behind a corporate proxy or VPN, you may need to configure proxy settings. The CheapClaude API endpoint (https://your-agent.cc/api) uses standard HTTPS.

Slow response times

Try the CC Official channel (optimized for coding tools). If on Hybrid channel, upgrade to CC Official for faster, more consistent streaming.

FAQ

Does Claude Code work with third-party API providers?

Yes. Claude Code supports any API endpoint that implements Anthropic's API format. Set ANTHROPIC_BASE_URL to your provider's URL.

Can I switch between channels?

Yes. Contact support to switch your key between channels (Hybrid $15, Antigravity $22, CC Official $36, AWS $47). Or get separate keys for different channels.

Is my code sent to CheapClaude's servers?

CheapClaude acts as a relay to Anthropic's API. Your code is sent to Anthropic for processing — same as using their direct API. CheapClaude does not store your prompts or code.


More guides: Cursor Setup · Channel Comparison · Web3 Teams · Home