Skip to main content

What is Claude Code?

Claude Code is a terminal-based AI development assistant created by Anthropic. It enables developers to accelerate coding workflows by using natural language to generate code, troubleshoot issues, refactor existing implementations, and perform a wide range of engineering tasks directly from the command line.
AGCloud provides a fully Anthropic-compatible API endpoint. Claude Code will display model names like claude-sonnet-4-6, but the actual model running behind the scenes is your chosen model (e.g., GLM-5, Kimi-K2.5, etc.).
With AGCloud, you can use 160+ AI models from top providers (Claude, OpenAI, Gemini, GLM, Kimi, MiniMax, DeepSeek, and more) directly in Claude Code — all with a single API key and no code changes required.

Two Ways to Use Claude Code

Step 1: Installation

Requires Node.js 20+
Install Claude Code via NPM:
npm install -g @anthropic-ai/claude-code
Check if the installation was successful.
claude --version # display version, e.g.: 2.x.x (Claude Code)
After installation, you can start with Claude Code AI.
cd your-project
claude
During your first run, Claude Code will prompt you to log in to your Anthropic account. You can skip this step.

Step 2: Configure AGCloud API

Quick Jump:

macOS/Linux Setup

Environment Variables (Quick Setup)

Append the commands below to ~/.bashrc, ~/.zshrc, or ~/.profile so they load automatically on every login.
export ANTHROPIC_BASE_URL=https://aiandgpu.com
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS='1'
export ANTHROPIC_AUTH_TOKEN=<YOUR_API_KEY>
export ANTHROPIC_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5-20251001'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'

Activate the Configuration

# Run the command that matches your current shell
source ~/.bashrc
source ~/.zshrc

Model Configuration (settings.json)

On macOS/Linux, Claude Code stores its config in ~/.claude/settings.json. Use it to persist all model mappings at once:
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://aiandgpu.com",
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001"
  }
}

Windows Setup

Environment Variables (Quick Setup)

Run these commands in PowerShell. To persist them, add the lines to $PROFILE or configure them via System Properties → Environment Variables.
$env:ANTHROPIC_BASE_URL = "https://aiandgpu.com"
$env:CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS = "1"
$env:ANTHROPIC_AUTH_TOKEN = "<YOUR_API_KEY>"
$env:ANTHROPIC_MODEL = "claude-sonnet-4-6"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "claude-haiku-4-5-20251001"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "claude-sonnet-4-6"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "claude-opus-4-6"

Activate the Configuration

# Restart PowerShell or manually reload your profile
. $PROFILE

Model Configuration (settings.json)

On Windows the config file lives at C:\\Users\\<USERNAME>\\.claude\\settings.json:
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://aiandgpu.com",
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001"
  }
}
Keep CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS='1' enabled for the best AWS Bedrock protocol compatibility. For every available variable, see Claude Code Env Vars.
After editing settings.json manually, fully restart Claude Code (and any IDE plugins) to load the changes.

Step 3: Choose Your Model

By default, Claude Code maps its internal model tiers to specific models. With AGCloud, you can customize which model powers each tier.

Default Model Mapping

Claude Code TierEnvironment VariableDefault ModelDescription
Opus (Heavy tasks)ANTHROPIC_DEFAULT_OPUS_MODELclaude-opus-4-6Complex reasoning, architecture
Sonnet (Main)ANTHROPIC_DEFAULT_SONNET_MODELclaude-sonnet-4-6Primary coding model
Haiku (Light tasks)ANTHROPIC_DEFAULT_HAIKU_MODELclaude-haiku-4-5-20251001Quick completions, small edits

Model Configuration Examples

Add the following to ~/.claude/settings.json:

Use Claude Models

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://aiandgpu.com",
    "ANTHROPIC_AUTH_TOKEN": "<YOUR_API_KEY>",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001"
  }
}

Step 4: Start with Claude Code

After configuration, start Claude Code in your project directory:
cd your-project
claude
You can now use natural language to interact with your codebase:
> Help me refactor the authentication module to use JWT tokens

> Find and fix the bug in the payment processing logic

> Write unit tests for the user service

> Explain the architecture of this project
Claude Code will show model names like claude-sonnet-4-20250514 in the UI, but the actual model running is your configured AGCloud model (e.g., GLM-5, Kimi-K2.5, etc.). This is expected behavior.

Available Models

Below are the recommended coding models provided by AGCloud:
Model NameUse ForSpeed
claude-opus-4-6Complex reasoning, full-stack development🌟🌟🌟🌟🌟
claude-sonnet-4-6Balanced coding, debugging🌟🌟🌟🌟🌟
claude-haiku-4-5-20251001Quick completions, lightweight tasks🌟🌟🌟🌟
AGCloud supports 160+ models. You can use any model from the model list as long as it supports the chat completions API.

FAQ

1. How to switch models?

You can switch models at any time by updating the environment variables in ~/.claude/settings.json and restarting Claude Code. Alternatively, set environment variables directly in your terminal before launching:
ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6
claude

2. Why does the UI still show “Claude” model names?

This behavior is intentional. Claude Code relies on Anthropic’s native model identifiers internally. AGCloud functions as a passthrough layer—it accepts requests using Claude model names and forwards them to the model you’ve configured. The underlying capabilities remain the same; only the displayed model name changes.

3. Manual config changes not taking effect?

If you edited ~/.claude/settings.json manually:
  1. Close Claude Code completely (not just the current session)
  2. If using the IDE plugin, restart the IDE
  3. Verify the JSON syntax is valid
  4. Re-launch Claude Code
# Verify your config
cat ~/.claude/settings.json | python3 -m json.tool
We recommend using the latest stable version of Claude Code for the best compatibility:
npm update -g @anthropic-ai/claude-code

5. Connection issues?

If you encounter connection errors:
  1. Verify your API key is valid: visit AGCloud Dashboard
  2. Check that ANTHROPIC_BASE_URL is set to https://aiandgpu.com (no trailing slash)
  3. Test connectivity:
curl https://aiandgpu.com/v1/messages \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","max_tokens":20,"messages":[{"role":"user","content":"Hi"}]}'