Skip to content

💻 Claude Code - AI Terminal Coding Assistant

This page explains how to configure Anthropic Claude Code CLI to access models through the agtcloud gateway, including:

  • Creating a dedicated token in the console
  • Installing Claude Code
  • Setting environment variables so Claude Code uses the https://api-cs-al.naci-tech.com/ gateway

1️⃣ Create a dedicated Claude Code token in the console

  1. Open the token page:
    https://api-cs-al.naci-tech.com/console/token
  2. Click Create Token.
  3. In Group/Tag, choose or create the group claude code.
  4. Recommended: keep this group dedicated for easier usage tracking and permission management.

2️⃣ Install Claude Code

Claude Code is Anthropic’s official terminal coding assistant. It supports macOS / Linux / Windows (including PowerShell / WSL).
Choose one installation method based on your OS.

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

After installation, reopen your terminal and run:

claude --version

If a version is printed, the installation is successful.

Windows (PowerShell)

Run in PowerShell:

irm https://claude.ai/install.ps1 | iex

Then verify:

claude --version

Other options (optional)

If you prefer a package manager, you can also install via (choose one):

  • npm (Node.js ≥ 18)
npm install -g @anthropic-ai/claude-code
  • Homebrew (macOS)
brew install claude-code

3️⃣ Set environment variables for the agtcloud gateway

To make Claude Code route requests through the agtcloud gateway, set the following environment variables.

macOS / Linux (bash / zsh)

Run in your terminal (replace <YOUR_TOKEN> with the token created in the console):

export ANTHROPIC_BASE_URL="https://api-cs-al.naci-tech.com/"
export ANTHROPIC_AUTH_TOKEN="<YOUR_TOKEN>"
export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"

Notes: - Replace ANTHROPIC_MODEL with the model you want to use.
- You can also switch models inside Claude Code with /model <model_name>, e.g. /model claude-3-5-sonnet-20241022.

To make it persistent across terminal sessions, append them to your shell rc file, for example:

echo 'export ANTHROPIC_BASE_URL="https://api-cs-al.naci-tech.com/"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="<YOUR_TOKEN>"' >> ~/.zshrc
echo 'export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"' >> ~/.zshrc

source ~/.zshrc

If you are using bash, replace ~/.zshrc with ~/.bashrc.

Windows (PowerShell)

For the current session:

$env:ANTHROPIC_BASE_URL = "https://api-cs-al.naci-tech.com/"
$env:ANTHROPIC_AUTH_TOKEN = "<YOUR_TOKEN>"
$env:ANTHROPIC_MODEL = "claude-sonnet-4-5-20250929"

To persist (user scope):

[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api-cs-al.naci-tech.com/", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "<YOUR_TOKEN>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-sonnet-4-5-20250929", "User")

Reopen PowerShell and the variables will take effect.


4️⃣ Verify it works through the agtcloud gateway

  1. In a terminal where the environment variables are set, run:
claude
  1. Go to any project directory and try a simple request (for example, ask it to read the current directory code).
  2. Return to the agtcloud console and confirm the call appears in Usage Logs, and the group is claude code.

If you can see the record in the console, Claude Code is successfully routed through the agtcloud gateway.