Skip to main content

Overview

Claude Code is Anthropic’s official command-line programming assistant. By configuring LaoZhang API, you can:

🚀 Stable Connection

Direct access, no proxy needed

💰 Cost Effective

No $200/month Claude Max subscription

⚡ High Concurrency

Unlimited parallel requests

🔧 Simple Setup

Complete configuration in minutes

Quick Start

Simplified Setup: If you don’t want to register a Claude account, check the Project Configuration section below. Using .claude.json file can completely bypass official verification.

1. Install Claude Code

Run the following command to install globally:
npm install -g @anthropic-ai/claude-code
Requires Node.js 18 or higher. If not installed, download from nodejs.org.

2. Get API Key

  1. Visit LaoZhang API Console
  2. Create a new token
  3. Copy the key for later use

3. Set Environment Variables

  • macOS/Linux
  • Windows
Edit ~/.zshrc or ~/.bashrc:
# LaoZhang API Configuration
export ANTHROPIC_API_KEY="sk-your-laozhang-api-key"
export ANTHROPIC_BASE_URL="https://api.laozhang.ai"
Apply changes:
source ~/.zshrc

4. Launch Claude Code

Navigate to your project directory and start:
cd ~/Desktop/my-project
claude
Create .claude.json in your project root to bypass Claude verification:
{
  "apiKey": "sk-your-laozhang-api-key",
  "apiBaseUrl": "https://api.laozhang.ai",
  "hasCompletedOnboarding": true
}
Important: Adding "hasCompletedOnboarding": true completely bypasses Claude account verification. No need to:
  • Register a Claude account (difficult, requires overseas phone)
  • Worry about account suspension
  • Complete any authorization steps
Security Note: .claude.json contains sensitive information:
  1. Add to .gitignore to avoid committing
  2. Don’t share project archives containing this file

Model Selection

Available models through LaoZhang API:
ModelModel IDFeaturesRecommended For
Claude 4 Sonnetclaude-sonnet-4-20250514Best codingComplex code tasks
Claude Opus 4.1claude-opus-4-20250514Enhanced reasoningDifficult problems
Claude 4 Sonnet Thinkingclaude-sonnet-4-20250514-thinkingChain of thoughtComplex reasoning
Claude 3.5 Sonnetclaude-3-5-sonnetStable, reliableDaily development

Usage Guide

Basic Commands

claude
# Shows API Key and Base URL
# Confirm configuration and continue

Workflow

  1. Start: Run claude in project directory
  2. Describe: Input your programming needs
  3. Interact: Claude understands context and provides suggestions
  4. Apply: Claude can directly modify files

Supported Features

  • ✅ Code generation and optimization
  • ✅ Bug fixing and debugging
  • ✅ Code refactoring
  • ✅ Documentation writing
  • ✅ Test case generation
  • ✅ Technical Q&A
  • ✅ Multi-file editing (Agent mode)

Troubleshooting

Check the following:
  1. Environment variables are correctly set
  2. API key is valid
  3. Network connection is stable
echo $ANTHROPIC_API_KEY
echo $ANTHROPIC_BASE_URL
Create .claude.json with hasCompletedOnboarding: true:
{
  "apiKey": "sk-your-laozhang-api-key",
  "apiBaseUrl": "https://api.laozhang.ai",
  "hasCompletedOnboarding": true
}
Ensure you’re using a LaoZhang API key. Check at LaoZhang API Console.
npm update -g @anthropic-ai/claude-code

Best Practices

Effective Prompts

Good prompts:
"Refactor this Python function for efficiency and add type annotations"
"This code has a memory leak, find and fix it"
"Write unit tests for this React component"

Avoid vague prompts:
"Improve my code"  # Too vague

Performance Tips

  1. Use project config: .claude.json avoids verification, faster startup
  2. Keep conversations coherent: Handle related tasks in one session
  3. Be specific: Clear descriptions reduce round trips
Need help? Visit LaoZhang API for support.