Integration Guide

Claude Code Setup

Run Anthropic's Claude Code CLI with CheapAI's proxy at up to 65% off. Two environment variables, no VPN, full streaming support.

What is Claude Code?

Claude Code is Anthropic's official CLI tool for agentic coding. It runs in your terminal, reads your project files, writes code, runs commands, and manages multi-file refactors — all powered by Claude.

Normally, Claude Code requires an Anthropic API key at official pricing. With CheapAI, you use the same tool at up to 65% off by pointing it at our proxy.

Prerequisites

  • Node.js 18+ installed
  • Claude Code installed: npm install -g @anthropic-ai/claude-code
  • A CheapAI API key and proxy URL (get one here)

Setup steps

1. Set environment variables

Claude Code reads ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL from your environment. Set both:

macOS / Linux (add to ~/.bashrc or ~/.zshrc):

export ANTHROPIC_API_KEY="your-cheapai-key"
export ANTHROPIC_BASE_URL="https://your-cheapai-proxy-url/anthropic"

Windows (PowerShell profile):

$env:ANTHROPIC_API_KEY = "your-cheapai-key"
$env:ANTHROPIC_BASE_URL = "https://your-cheapai-proxy-url/anthropic"

2. Launch Claude Code

cd your-project-directory
claude

Claude Code will automatically use the API key and base URL from your environment. No additional configuration needed.

3. Verify the connection

Type a simple prompt like explain this project. If Claude responds with a description of your codebase, the proxy is working correctly.

Available models for Claude Code

Model Best for Thinking
Claude Claude 3 Opus Complex refactoring, architecture, multi-file changes
Claude 3.5 Sonnet Daily coding, features, bug fixes (best value)
Claude 3 Opus Proven capability, demanding tasks
Claude 3.5 Haiku Fast automated tasks, classification

Claude Code will use its default model (usually Sonnet). To change the model, use Claude Code's /model command.

Tips & troubleshooting

  • No VPN needed — CheapAI's proxy handles geo-routing automatically.
  • Streaming works — you'll see Claude's response stream token-by-token in the CLI.
  • You can use Claude Code Plans — CheapAI's Claude Code Max plans include daily call limits and work with all 4 Claude models. See plans.
  • "Connection refused" error? — Double-check ANTHROPIC_BASE_URL does NOT have a trailing slash.
  • Rate limits? — Upgrade your CheapAI plan for higher daily call limits.

Code with Claude at up to 65% off

Get a Claude Code-compatible API key. Works with all Claude models.

Get API Access