Claude Code is Anthropic’s official CLI tool for AI-assisted coding — think of it as “Cursor in the terminal.” It’s powerful, but it burns through API credits fast.
Here’s how to set it up with your own API key so you can use Opus 4.6 at up to 93% less cost.
Claude Code vs Cursor: What’s the Difference?
| Feature | Claude Code | Cursor IDE |
|---|---|---|
| Interface | Terminal / CLI | VS Code fork |
| Best for | Full-project refactoring, agentic tasks | Daily coding, inline edits |
| Custom API | ✅ Environment variables | ✅ Settings UI |
| Model access | Claude models only | Multi-provider |
Both support custom API keys. This guide covers Claude Code specifically. For Cursor, see our Cursor setup guide.
Step 1: Install Claude Code
npm install -g @anthropic-ai/claude-code
Requirements:
- Node.js 18+
- macOS, Linux, or WSL on Windows
Step 2: Set Your API Key and Endpoint
Add these to your shell profile (~/.zshrc, ~/.bashrc, or ~/.profile):
export ANTHROPIC_API_KEY="sk-ba-your-key-here"
export ANTHROPIC_BASE_URL="https://business-agent.cc/api"
Then reload your shell:
source ~/.zshrc
Where to get your API key? Contact us at hello@your-agent.cc or Telegram. Free $5–$10 trial credit for new users.
Step 3: Start Claude Code
Navigate to your project and run:
cd your-project
claude
Claude Code will automatically use your custom endpoint. You’ll see the Claude Code prompt appear:
claude>
Step 4: Verify It’s Working
Type a simple command:
claude> Explain the structure of this project
If you get a detailed response about your project files, you’re connected through your custom API key.
Advanced: Choose Your Model
By default, Claude Code uses the best available model. You can specify:
# Use Opus 4.6 for complex tasks
claude --model claude-opus-4-20250514
# Use Codex for coding tasks (cheapest)
claude --model codex-5.3-high
Pricing: How Much Does This Save?
| Model | Official Anthropic | Via BusinessAgent | Savings |
|---|---|---|---|
| Opus 4.6 (Direct) | $100 / 50M tokens | $36 / 50M tokens | 64% |
| Opus 4.6 (Subscription) | $100 / 50M tokens | $22 / 50M tokens | 78% |
| Codex 5.3 High | $100 / 50M tokens | $7 / 50M tokens | 93% |
Most Claude Code usage is coding tasks where Codex at $7 is the best value. For complex reasoning or architecture discussions, switch to Opus.
Troubleshooting
“Connection refused” or timeout:
- Check that
ANTHROPIC_BASE_URLdoesn’t have a trailing slash - Run
echo $ANTHROPIC_BASE_URLto verify it’s set correctly
“Invalid API key”:
- Make sure the key starts with
sk-ba- - Contact us if you need a new key
“Model not available”:
- Check available models at
https://business-agent.cc/api/v1/models
Works With Other Tools Too
The same ANTHROPIC_BASE_URL environment variable works with:
- Claude Code (this guide)
- Cursor IDE (setup guide)
- VS Code + Continue extension
- Any OpenAI-compatible tool
Set it once, use it everywhere.
Ready to start? Get your API key → hello@your-agent.cc · Telegram · WeChat: Moumlbius
🎁 Free $5–$10 trial credit for new users. Team plans available →