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"
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
Field reference
ANTHROPIC_BASE_URL: the CQT AI gateway addresshttps://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_TOKENis correct with no extra spaces, and confirm the APIKey isn't disabled. - Connection failed: Confirm
ANTHROPIC_BASE_URLishttps://api.cqtai.comand the network is reachable. - Config doesn't take effect: Confirm
settings.jsonis inside the.claudefolder with valid JSON (no trailing commas), then reopen the terminal after saving.