Claude Code Setup (CLI)

Point Claude Code at the CQT AI gateway via its config file to use the platform's Claude-compatible models.

💡 Beginner tip: graphical setup with CC-Switch is easier (see "CC-Switch Setup" on the left). The manual setup is below.

Prerequisites

  • You've obtained a CQT AI APIKey (created in the console under "APIKey Management").
  • You've installed Claude Code (npm i -g @anthropic-ai/claude-code).

Step 1: Open the config folder

Open your terminal (PowerShell / CMD on Windows, Terminal on macOS), and run the command for your OS to open the Claude Code config folder:

# Windows (CMD)
start "" "%USERPROFILE%\.claude"

# macOS / Linux
open "$HOME/.claude"

Open the .claude config folder

Step 2: Create settings.json

Manually create settings.json in that folder with the following content:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "",
    "ANTHROPIC_BASE_URL": "https://api.cqtai.com",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Step 3: Fill in the APIKey

Replace the value of ANTHROPIC_AUTH_TOKEN with the APIKey you created in the console, and save the file.

Step 4: Verify

Run claude in the terminal and chat to test that the setup works:

claude

Run claude to verify

Field reference

  • ANTHROPIC_BASE_URL: the CQT AI gateway address https://api.cqtai.com.
  • ANTHROPIC_AUTH_TOKEN: your APIKey.
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: disables non-essential telemetry; keeping "1" is recommended.

FAQ

  • 401 authentication failed: Check that ANTHROPIC_AUTH_TOKEN is correct with no extra spaces, and confirm the APIKey isn't disabled.
  • Connection failed: Confirm ANTHROPIC_BASE_URL is https://api.cqtai.com and the network is reachable.
  • Config doesn't take effect: Confirm settings.json is inside the .claude folder with valid JSON (no trailing commas), then reopen the terminal after saving.