Documentation Index
Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Claude Code is Anthropic’s official command-line tool that brings Claude’s intelligence directly into your terminal. It can understand your codebase, edit files, run commands, and help you build software faster. By connecting Claude Code CLI to FoxAPI, you can access Claude’s full capabilities through FoxAPI’s reliable API infrastructure — direct network access from China, pay-as-you-go with no balance expiration, and transparent, traceable channels.We provide a dedicated endpoint optimized for Claude Code CLI. Use
https://api.foxapi.cc as the Base URL for the best experience.Prerequisites
Node.js 18+
Required for installing Claude Code via npm. Download Node.js →
Git
Git is required for Claude Code to function properly. Download Git →
FoxAPI API Key
You need a valid FoxAPI API Key. See the installation steps below for how to obtain one. Go to FoxAPI →
Python (Optional)
Some advanced features may require a Python environment. Download Python →
Installation & Configuration
Step 1: Install Claude Code CLI
Choose your installation method based on your operating system:Verify the installation:
- Windows (npm)
- macOS / Linux (Recommended)
- macOS / Linux (npm)
Open a new PowerShell window and run:
Step 2: Get Your API Key
Go to the FoxAPI Console and complete the following:
- Create an account: Register at api.foxapi.cc
- Create an API key: On the API Keys page, click “Create Key”
Step 3: Configure Environment
We recommend using CC-Switch for one-click configuration, or you can manually edit the configuration file.
- CC-Switch (Recommended)
- Settings File (Manual)
- Environment Variables (Manual)
CC-Switch is a configuration tool built for Claude Code that supports one-click API Key import.
- Download and install from CC-Switch GitHub Releases:
- Windows: Download
CC-Switch-xxxx-Windows.msiand install - macOS: Download
CC-Switch-xxxx-macOS.dmgand install
- Windows: Download
- Open the API Keys page in the FoxAPI Console, and click the “Import to CCS” button to automatically complete the configuration

Step 4: Install VSCode Extension (Optional)
If you use VSCode, you can install the official extension for a better integrated experience:



- Download and install VSCode
- Search for Claude Code in the extension marketplace. Make sure the author is Anthropic

- After installation, you’ll see the Claude Code panel in the VSCode sidebar



Verify the Connection
Run the following command to confirm Claude Code is correctly routing through FoxAPI:Usage Examples
Explore a codebase
Explore a codebase
Fix a bug
Fix a bug
Write tests
Write tests
Refactor code
Refactor code
Troubleshooting
Error: Authentication failed or 401 Unauthorized
Error: Authentication failed or 401 Unauthorized
Error: Connection refused or timeout
Error: Connection refused or timeout
- Verify
ANTHROPIC_BASE_URLis set tohttps://api.foxapi.cc(no trailing slash). - Check your network connection and ensure you can reach
api.foxapi.cc. - If you are behind a corporate proxy, ensure the proxy allows HTTPS traffic to
api.foxapi.cc.
Claude Code still tries to connect to Anthropic directly
Claude Code still tries to connect to Anthropic directly
- Make sure
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICis set to1. - If using
settings.json, ensure the JSON syntax is valid (no trailing commas, proper quoting). - Restart your terminal after making changes to environment variables or settings.
Settings file not taking effect
Settings file not taking effect
- Confirm the file is located at
~/.claude/settings.json(not inside your project directory). - Validate the JSON format using a tool like
jq: - Ensure there are no conflicting environment variables set in your shell profile that might override the settings file.
Security Best Practices
- Never commit your API key to version control. If using environment variables, add them to your shell profile rather than project files.
- Use dedicated keys when possible. FoxAPI allows you to create multiple API keys — use a dedicated key for Claude Code so you can revoke it independently if needed.
- Monitor usage on the FoxAPI Console to detect any unexpected consumption.
