Skip to content

Claude Code

Using Claude Code with Fast-Token

Quick start

This guide helps you get started with Claude Code powered by Fast-Token in just a few minutes.

1. Install Claude Code

Local install

bash
curl -fsSL https://claude.ai/install.sh | bash
bash
irm https://claude.ai/install.ps1 | iex

Install with npm

Requires Node.js 18 or later

bash
npm install -g @anthropic-ai/claude-code

2. Configure the Fast-Token API

To use Fast-Token model services through an Anthropic API–compatible setup, configure the following environment variables.

  1. Set BASE_URL to https://fast-token.com
  2. Set AUTH_TOKEN to the API Key from the Fast-Token platform
  3. Set MODEL to a model supported in the model list.

macOS

  1. In Terminal, run the following command to check your default shell type.
bash
echo $SHELL
  1. Set environment variables according to your shell type:
bash
# Replace <Fast-Token_API_KEY> with your Key from the Fast-Token platform
echo 'export BASE_URL="https://fast-token.com"' >> ~/.zshrc
echo 'export AUTH_TOKEN="<Fast-Token_API_KEY>"' >> ~/.zshrc
echo 'export MODEL="claude-sonnet-4-5"' >> ~/.zshrc
bash
# Replace <Fast-Token_API_KEY> with your Key from the Fast-Token platform
echo 'export BASE_URL="https://fast-token.com"' >> ~/.bash_profile
echo 'export AUTH_TOKEN="<Fast-Token_API_KEY>"' >> ~/.bash_profile
echo 'export MODEL="claude-sonnet-4-5"' >> ~/.bash_profile
  1. In Terminal, run the following commands to apply the environment variables.
bash
source ~/.zshrc
bash
source ~/.bash_profile
  1. Open a new terminal and run the following commands to verify the environment variables are set.
bash
echo $BASE_URL
echo $AUTH_TOKEN
echo $MODEL

Windows

On Windows, you can set Fast-Token’s Base URL and API Key as environment variables via CMD or PowerShell.

CMD
  1. In CMD, run the following commands to set environment variables.
bat
REM Replace <Fast-Token_API_KEY> with your Fast-Token API Key
setx AUTH_TOKEN "<Fast-Token_API_KEY>"
setx BASE_URL "https://fast-token.com"
setx MODEL "claude-sonnet-4-5"
  1. Open a new CMD window and run the following commands to verify the environment variables are set.
bat
echo %AUTH_TOKEN%
echo %BASE_URL%
echo %MODEL%
PowerShell
  1. In PowerShell, run the following commands to set environment variables.
powershell
# Replace <Fast-Token_API_KEY> with your Fast-Token API Key
[Environment]::SetEnvironmentVariable("AUTH_TOKEN", "<Fast-Token_API_KEY>", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("BASE_URL", "https://fast-token.com", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("MODEL", "claude-sonnet-4-5", [EnvironmentVariableTarget]::User)
  1. Open a new PowerShell window and run the following commands to verify the environment variables are set.
powershell
echo $env:AUTH_TOKEN
echo $env:BASE_URL
echo $env:MODEL

3. Start using

After configuration is complete, go to your project directory and run claude in the terminal to start using Claude Code.

bash
cd /path/your-project
claude

On first use, Claude Code may require you to sign in to an Anthropic account. Follow these steps to skip that flow:

Skip Anthropic sign-in

  1. Locate the .claude.json file in your user home directory:
    • macOS / Linux: ~/.claude.json
    • Windows: C:\Users\%USERNAME%\.claude.json
  2. Set the hasCompletedOnboarding field to true
json
{
  "hasCompletedOnboarding": true
}
  1. Save the file, then run claude again in the terminal.

(Optional) More ways to configure models

Claude Code supports the following model configuration methods, listed from highest to lowest priority. Higher-priority settings override lower-priority ones.

  1. During a conversation: Run /model <model name> to switch models. Best for temporary changes.
text
/model claude-sonnet-4-5
  1. When starting Claude Code: Run claude --model <model name> to specify a model. Best for a single session.
text
claude --model claude-sonnet-4-5
  1. Environment variables: Configure different model tiers by task complexity; Claude Code picks the appropriate model automatically. Applies globally.
bash
export DEFAULT_OPUS_MODEL="claude-opus-4-5"
export DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
export DEFAULT_HAIKU_MODEL="claude-haiku-4-5"

Where:

  • DEFAULT_OPUS_MODEL: Complex reasoning, architecture design, and other high-difficulty tasks.
  • DEFAULT_SONNET_MODEL: Everyday tasks such as writing code and implementing features.
  • DEFAULT_HAIKU_MODEL: Simple tasks such as syntax checks and file search.
  1. Permanent settings in settings.json: Create a settings.json file in the project root or user home directory and add model configuration for project-level or user-level permanent settings.
json
{
  "env": {
    "DEFAULT_OPUS_MODEL": "claude-opus-4-5",
    "DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
    "DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
  }
}

Configure via cc-switch

  1. Run CC-Switch and click Add provider.

Add provider

  1. In the preset list, select Custom configuration.

Custom configuration

  1. In the API Key field, enter your key and request URL.

Enter API Key

  1. After configuration, click Add to save.

Save settings

  1. Return to the home page, select Fast-Token in the provider list, and click Start to begin.

Start provider

Configure via VS Code extension

  1. Open VS Code and install the extension.

Install VS Code extension

  1. Press Ctrl + Shift + P (or Cmd + Shift + P), type Settings, and open settings.

Open settings

  1. Search for Claude Code, then find Claude Code: Environment VariableEdit in settings.json.

Environment variable setting

  1. Fill in Fast-Token details under claudeCode.environmentVariables.

Enter environment variables

Use DeepSeek models in Claude Code

Available models: deepseek-r1-distill-qwen-14b, deepseek-v3, deepseek-v3-0324, deepseek-v3-1-250821, deepseek-v3.2, deepseek-v4-flash, deepseek-v4-pro

Method 1: Edit the configuration file directly

Locate the .claude.json file in your user home directory:

  • macOS / Linux: ~/.claude.json
  • Windows: C:\Users\%USERNAME%\.claude.json

Change the value of ANTHROPIC_MODEL to a DeepSeek model name:

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-**",
    "ANTHROPIC_BASE_URL": "https://fast-token.com",
    "ANTHROPIC_MODEL": "deepseek-v4-pro"
  },
  "includeCoAuthoredBy": false
}

Method 2: Use CC Switch to edit the configuration file, set the model name to a DeepSeek model, then restart Claude Code.

FAQ

Q: Using Claude Code shows「401 , No token provided....」

Open the Claude terminal, type /config, find the Use custom API key option, and verify the Token is configured correctly.

Check Token configuration

Q: After successful install on macOS, still get zsh: command not found: claude

The Claude CLI is installed, but its executable directory is not on your system PATH.

  1. Confirm the Claude install path. The official Claude Code script usually installs to one of:
  • ~/.claude/bin
  • ~/.local/bin

In Terminal, run:

bash
ls -l ~/.claude/bin
# or
ls -l ~/.local/bin | grep claude

If you see the claude file, installation succeeded; only PATH needs to be configured.

  1. Add the install directory to PATH. Run the command that matches your install location:

Case A: Installed in ~/.claude/bin

bash
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Case B: Installed in ~/.local/bin

bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
  1. Verify it works. Run:
text
which claude
claude -v

If you see the claude path and version number, installation succeeded.

Q: Claude Code cannot connect to Anthropic services

After upgrading to the latest Claude Code, if you cannot connect to Anthropic services or authentication fails, it is usually because the auth request header name changed. Newer versions require changing the header from API_KEY to AUTH_TOKEN. The API Key value stays the same; only update the header name and reload configuration. See this document to reconfigure.

Q: Login: API Error: 403

Login API Error 403

Upgrade cc to the latest version, and disable local proxy and failover in ccs.

Happy coding!