Overview
Claude Code is Anthropic’s official command-line programming assistant, allowing you to use Claude’s powerful programming capabilities directly in the terminal. By configuring APIYI service, you can get:🚀 Stable Connection
Direct connection without proxy, no network instability
💰 Cost-Effective
No need for Claude Max $200 subscription
⚡ High Concurrency
Unlimited access powered by APIYI
🔧 Simple Setup
Complete setup in minutes
Quick Start
Simplified Configuration Tip: If you don’t want to register for a Claude official account, we recommend checking the Advanced Configuration section below to use
.claude.json file configuration, which completely bypasses official verification.1. Install Claude Code
Run the following command in terminal to install globally:Requires Node.js 18 or higher. If not installed, please visit nodejs.org to download and install.
2. Configure API Key
Get API Key
- Visit APIYI Console
- Generate a new key in the [Token] section
- Copy the key for later use
Set Environment Variables
Add APIYI configuration to your system environment variables.- macOS/Linux
- Windows
Edit
~/.zshrc or ~/.bashrc file:Mac User Tip: Press
⌘ + ⇧ + . in your user directory to show hidden files, then use a text editor to open the .zshrc file.3. Apply Configuration
- macOS/Linux
- Windows
4. Launch Claude Code
Enter your project directory and launch:Advanced Configuration
Project-Level Configuration (Recommended)
Create.claude.json file in project root directory to bypass Claude official verification:
Important Note: Adding
"hasCompletedOnboarding": true completely bypasses Claude official account verification, allowing direct use of APIYI service. This means you don’t need to:- Register for Claude official account (difficult registration, requires overseas phone number)
- Worry about Claude official account being banned
- Perform any additional authorization steps
Security Reminder:
.claude.json file contains sensitive information, please ensure:- Add to
.gitignoreto avoid committing to version control - Don’t share project archives containing this file
Global Authorization (Not Recommended)
If you don’t configurehasCompletedOnboarding: true, authorization page will appear on first use:
- Need to redirect to Claude official website for confirmation
- Requires Claude official account (difficult registration and easily banned)
- Return to terminal after successful authorization
Recommendation: Strongly recommend using the
.claude.json configuration method above to avoid various limitations of Claude official accounts.User Guide
Basic Commands
After launching, Claude Code will display current configuration information:Workflow
- Launch Assistant: Run
claudein project directory - Describe Requirements: Enter your programming needs or questions
- Interactive Dialogue: Claude understands context and provides code suggestions
- Apply Changes: After confirmation, Claude can directly modify files
Supported Features
- ✅ Code generation and optimization
- ✅ Bug fixing and debugging
- ✅ Code refactoring suggestions
- ✅ Documentation writing
- ✅ Test case generation
- ✅ Technical Q&A
Model Selection
Claude Code uses the latest Claude models by default. Through APIYI, you can access:| Model | Features | Recommended Scenarios |
|---|---|---|
| Claude 4 Sonnet | Strongest programming | Complex code tasks |
| Claude Opus 4.1 | Performance upgrade | High-demand programming |
| Claude 4 Sonnet Thinking | Chain-of-thought mode | Complex reasoning |
Troubleshooting
Common Issues
Unable to Connect to Anthropic Services
Unable to Connect to Anthropic Services
This is usually a network configuration issue. Please check:
- Environment variables are set correctly
- API key is valid
- Network connection is normal
Prompted for Claude Official Account Authorization
Prompted for Claude Official Account Authorization
Invalid API Key
Invalid API Key
Make sure you’re using APIYI’s key, not Claude official website’s key. Generate new key at APIYI Console.
How to Update Claude Code
How to Update Claude Code
Run the following command to update to latest version:
Which Programming Languages are Supported
Which Programming Languages are Supported
Claude Code supports all mainstream programming languages, including but not limited to:
- Python, JavaScript/TypeScript, Java, C++, C#
- Go, Rust, Swift, Kotlin
- HTML/CSS, SQL, Shell Scripts
- And more…
Best Practices
Effective Prompts
Project Structure Recommendations
- Keep codebase clean and organized
- Use clear file naming
- Add appropriate comments
- Provide project README
Performance Optimization
Improve Response Speed
- Use Project Configuration:
.claude.jsonconfiguration avoids verification each time, especially faster startup after settinghasCompletedOnboarding: true - Maintain Conversation Coherence: Handle related tasks in same session
- Clear Requirements: Clear descriptions reduce round-trip interactions
Cost Control
- Claude Code charges based on Token usage
- Enjoy preferential prices through APIYI
- Check Pricing Page for details
Related Resources
Official Documentation
Claude Code official documentation
APIYI Console
Manage API keys
Model Introduction
Learn about Claude series models
Other Programming Tools
Explore tools like Cursor
Summary
Claude Code combined with APIYI service provides developers with a powerful, stable, and economical AI programming assistant solution. Enjoy top-tier AI programming experience without expensive subscription fees.Tip: For more AI tools in programming scenarios, check out OpenAI Codex CLI and other options.