CQTAI

Claude Code Setup (VS Code)

After installing the Claude Code extension in VS Code, point it at the CQT AI gateway to use the platform's Claude-compatible models inside the editor.

Prerequisites

  • You've obtained a CQT AI APIKey (created in the console under "APIKey Management").
  • You've installed VS Code and the "Claude Code for VS Code" extension.

Step 1: Open the settings file

In VS Code: right-click the "Claude Code for VS Code" extension → Settings → edit the config in settings.json (or run "Preferences: Open User Settings (JSON)" via Ctrl+Shift+P).

Step 2: Write the config

Merge the following into settings.json (set the ANTHROPIC_AUTH_TOKEN value to your APIKey):

{
  "permissions": {
    "allow": [
      "Read",
      "Edit",
      "Glob",
      "Grep",
      "Docker",
      "mvn",
      "Bash(npm run test)",
      "Bash(npm run build)",
      "Bash(git status)",
      "Bash(git diff)",
      "COMPOSE_HTTP_TIMEOUT"
    ],
    "deny": ["Bash(rm -rf *)", "Bash(git push)"]
  },
  "claudeCode.preferredLocation": "panel",
  "claudeCode.environmentVariables": [
    { "name": "ANTHROPIC_AUTH_TOKEN", "value": "your-APIKey" },
    { "name": "ANTHROPIC_BASE_URL", "value": "https://api.cqtai.com" },
    { "name": "ANTHROPIC_MODEL", "value": "claude-opus-4-8" },
    { "name": "CLAUDE_CODE_SUBAGENT_MODEL", "value": "claude-opus-4-8" },
    { "name": "ANTHROPIC_DEFAULT_OPUS_MODEL", "value": "claude-opus-4-8" },
    { "name": "ANTHROPIC_DEFAULT_SONNET_MODEL", "value": "claude-sonnet-4-6" },
    { "name": "CLAUDE_CODE_SKIP_AUTH_LOGIN", "value": "1" },
    { "name": "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "value": "1" },
    { "name": "CLAUDE_CODE_ATTRIBUTION_HEADER", "value": "0" }
  ],
  "files.autoGuessEncoding": true,
  "workbench.activityBar.compact": true
}

Step 3: Save and restart

Save settings.json and restart VS Code for the config to take effect.

Configuration reference

permissions (access control)

Controls the operations Claude Code may perform, improving security:

  • allow: allowlist. Permitted tools/commands, such as Read (read files), Edit (edit files), Glob/Grep (search), Docker, mvn, and specific Bash commands (Bash(npm run test), Bash(git status), etc.).
  • deny: denylist. Forbidden dangerous commands, such as Bash(rm -rf *) (wipe) and Bash(git push) (push).

The denylist takes precedence over the allowlist; operations not in allow follow the extension's default prompt policy.

claudeCode.preferredLocation

The Claude Code panel location; panel docks it in the bottom panel.

claudeCode.environmentVariables (core)

The keys to connecting to CQT AI, item by item:

VariablePurpose
ANTHROPIC_AUTH_TOKENYour CQT AI APIKey (for auth)
ANTHROPIC_BASE_URLThe CQT AI gateway address https://api.cqtai.com
ANTHROPIC_MODELThe default model, e.g. claude-opus-4-8
CLAUDE_CODE_SUBAGENT_MODELThe model used for subagent tasks
ANTHROPIC_DEFAULT_OPUS_MODELDefault model for the Opus tier
ANTHROPIC_DEFAULT_SONNET_MODELDefault model for the Sonnet tier, e.g. claude-sonnet-4-6
CLAUDE_CODE_SKIP_AUTH_LOGIN1 skips the official login flow (needed when authing with a gateway key)
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1 disables non-essential telemetry
CLAUDE_CODE_ATTRIBUTION_HEADER0 disables the attribution header

Others

  • files.autoGuessEncoding: auto-detect file encoding.
  • workbench.activityBar.compact: compact activity bar (unrelated to Claude Code, optional).

FAQ

  • Extension doesn't take effect: Confirm you configured it in the "User settings.json" rather than workspace settings, then fully restart VS Code after saving.
  • 401 authentication failed: Check that ANTHROPIC_AUTH_TOKEN is correct with no extra spaces, and confirm the APIKey isn't disabled.
  • Model unavailable: Confirm ANTHROPIC_MODEL and other model names are available on the platform (see the "Chat" model list).