Skip to main content

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 →
After installation, open a terminal (PowerShell on Windows) to verify your environment:
node -v
git --version
Windows users: If you encounter errors running commands, open PowerShell as Administrator and run the following command, then select A:
Set-ExecutionPolicy RemoteSigned
Windows Execution Policy Setting

Installation & Configuration

1

Step 1: Install Claude Code CLI

Choose your installation method based on your operating system:
Open a new PowerShell window and run:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
2

Step 2: Get Your API Key

Go to the FoxAPI Console and complete the following:
  1. Create an account: Register at api.foxapi.cc
  2. Create an API key: On the API Keys page, click “Create Key”
When creating a key, you must select the “Claude-Max” group. This is the official channel dedicated to Claude Code for the best experience. Other groups may not support Claude Code or may have feature limitations.
3

Step 3: Configure Environment

We recommend using CC-Switch for one-click configuration, or you can manually edit the configuration file.
The CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC setting is required. It prevents Claude Code from sending telemetry and other non-essential requests to Anthropic’s servers. Without this setting, those requests will fail due to lacking an official API Key, which may cause errors.
4

Step 4: Install VSCode Extension (Optional)

If you use VSCode, you can install the official extension for a better integrated experience:
  1. Download and install VSCode
  2. Search for Claude Code in the extension marketplace. Make sure the author is Anthropic
Verify the author is Anthropic
  1. After installation, you’ll see the Claude Code panel in the VSCode sidebar
Claude Code panel in VSCode
If the side panel doesn’t appear, the environment variables may not be configured correctly, or your FoxAPI account may have insufficient balance.
Environment not configured or insufficient balancePanel after successful configuration
5

Step 5: Start Using

Launch Claude Code in your project directory:
cd /path/to/your/project
claude
This opens an interactive session where you can chat with Claude about your codebase.You can also run one-off commands:
claude "Explain the architecture of this project"

Verify the Connection

Run the following command to confirm Claude Code is correctly routing through FoxAPI:
claude "Hello, please confirm you are working properly."
If configured correctly, Claude will respond normally. If you see an error, check the Troubleshooting section below.

Usage Examples

claude "Give me an overview of this project's architecture"
claude "There's a bug in the login flow where users get redirected to a 404 page after authentication. Find and fix it."
claude "Write unit tests for the UserService class"
claude "Refactor the database queries in src/repositories to use parameterized queries"

Troubleshooting

  • Double-check your ANTHROPIC_AUTH_TOKEN value. It should be your FoxAPI API Key (starts with sk-).
  • Ensure your API key has not expired and has sufficient balance.
  • Verify the key has access to Claude models on your FoxAPI account.
  • Verify ANTHROPIC_BASE_URL is set to https://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.
  • Make sure CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC is set to 1.
  • 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.
  • Confirm the file is located at ~/.claude/settings.json (not inside your project directory).
  • Validate the JSON format using a tool like jq:
    cat ~/.claude/settings.json | 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.