LLM API

Claude Code

Integrate ARZASTORE AI API with Claude Code — AI coding assistant in the terminal

What is Claude Code?

System Requirements

Operating System

  • macOS / Linux (Terminal with Bash/Zsh)
  • Windows (PowerShell)

Account

  • ARZASTORE AI account with sufficient balance
  • Consumer API Key (sk-xxx)
  • Subscribed to a Claude model (Haiku/Sonnet/Opus)

Install Claude Code

Run the installation command for your operating system:

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

Verify successful installation:

claude --version

Update Version

Automatic Configuration via Dashboard (Recommended)

ARZASTORE AI provides an automatic configuration script for all operating systems. Just go to the Dashboard, select a model, and copy a single command.

Steps to get the setup command

  1. 01Go to Console → API Keys, click the API Key you want to use to open details
  2. 02Switch to the Claude Code tab
  3. 03Select your operating system (macOS/Linux or Windows)
  4. 04Choose model for each tier from your subscriptions list:Haiku— Fast model, for simple tasks (auto-complete, quick questions)Sonnet— Default model, balanced speed/quality (coding, debugging)Opus— Most powerful model, for complex tasks (architecture, deep analysis)
  5. 05Click "Get Setup Command", copy the command and paste it into your terminal
  6. 06Restart the terminal, then run claude to get started
  • Haiku— Fast model, for simple tasks (auto-complete, quick questions)
  • Sonnet— Default model, balanced speed/quality (coding, debugging)
  • Opus— Most powerful model, for complex tasks (architecture, deep analysis)

Recommended: Subscribe to all 3 tiers

Manual Configuration

If not using the automatic script, you can configure manually in 2 steps:

Step A: Environment Variables

Claude Code reads 2 environment variables to connect to the API:

VariableValueDescription
ANTHROPIC_API_KEYsk-your-api-keyConsumer API Key from ARZASTORE AI
ANTHROPIC_BASE_URLhttps://api.arzastore.com/v1Endpoint URL from Marketplace

Step B: settings.json file (optional)

The Claude Code config file is located at:

  • Windows: %APPDATA%claudesettings.json
  • Linux/macOS: ~/.claude/settings.json
{
 "apiKeyHelper": "echo $ANTHROPIC_API_KEY",
 "permissions": {
 "allow": [
 "Bash(npm install:*)",
 "Bash(npm test:*)",
 "Bash(git status:*)"
 ],
 "deny": []
 },
 "model": "claude-sonnet-4-20250514"
}

Select a Model

Claude Code supports all Claude models. You need to subscribe to the corresponding model on the Marketplace and use the exact alias or model ID.

ModelModel IDFeatureSuitable For
Haiku 4.5claude-haiku-4.5Fast, low costSimple tasks, auto-complete
Sonnet 4.6claude-sonnet-4-20250514Balanced speed/qualityCoding, debugging, refactoring (default)
Opus 4.6claude-opus-4-20250514Highest qualityComplex analysis, large architecture

Switch Models in Claude Code

# Đổi model bằng lệnh trong Claude Code
/model claude-sonnet-4-20250514
# Hoặc đổi model bằng biến môi trường
export CLAUDE_MODEL="claude-sonnet-4-20250514"
# Hoặc đổi trong settings.json
# "model": "claude-sonnet-4-20250514"

Use Aliases for Easy Management

Useful Commands

Displays the current model, connection status, and session information.

Switch between Claude models (Haiku, Sonnet, Opus) in the current session.

Clear conversation history to save tokens and start a fresh context.

Display a list of all available commands and shortcuts.

Summarize conversation history to reduce token usage, useful when context is too long.

First Run

After configuration is complete, open a terminal in your project directory and run:

# Mở Claude Code trong thư mục dự án
cd /path/to/your/project
claude
# Hoặc chạy với lệnh cụ thể
claude "Giải thích cấu trúc của dự án này"
# Chạy với model cụ thể
claude --model claude-sonnet-4-20250514 "Tìm bug trong file main.py"

Usage Examples

Refactor code:

Debug an error:

Write tests:

Troubleshooting

Error: "Invalid API key" or "401 Unauthorized"

  • - Check the ANTHROPIC_API_KEY variable is set correctly
  • - Run echo $ANTHROPIC_API_KEY to verify
  • - Ensure the key starts with sk-
  • - Check the key has not been deleted in the Dashboard

Error: "Connection refused" or "ECONNREFUSED"

  • - Check ANTHROPIC_BASE_URL is correct
  • - Ensure the URL ends with /v1
  • - Check your internet connection
  • - Try accessing the URL in a browser to verify the provider is online

Error: "Model not found" or "403 Forbidden"

  • - Check if you have subscribed to the Claude model on the Marketplace
  • - Go to Dashboard → API Keys → Subscriptions to verify
  • - Ensure the model ID or alias in Claude Code matches the subscription
  • - Try switching the model: /model claude-sonnet-4-20250514

Error: "Insufficient balance" or "402 Payment Required"

  • - Account balance is insufficient
  • - Top up at Console → Top Up
  • - Check model costs in Dashboard → Usage

Quick Debug

# Kiểm tra cấu hình
echo "API Key: $ANTHROPIC_API_KEY"
echo "Base URL: $ANTHROPIC_BASE_URL"
# Test kết nối bằng curl
curl -s "$ANTHROPIC_BASE_URL/models"  -H "Authorization: Bearer $ANTHROPIC_API_KEY" | head -c 200
# Kiểm tra Claude Code status
claude /status

Uninstall

Fully Uninstall Claude Code

You can get the automatic uninstall command from the Dashboard: go to API Keys → select a key → Claude Code tab → "Uninstall" section.

Or uninstall manually:

# Gỡ Claude Code (Linux/macOS)
rm -rf ~/.claude
# Xóa biến môi trường — sửa ~/.bashrc hoặc ~/.zshrc
# Xóa 2 dòng: ANTHROPIC_API_KEY và ANTHROPIC_BASE_URL
# Gỡ Claude Code (Windows PowerShell)
Remove-Item -Recurse -Force "$env:APPDATAclaude"
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", $null, "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User")

Tips for Effective Use

  • -Use Haiku for simple tasks (Q&A, code explanation) to save costs Haiku
  • -Use Sonnet for daily coding (default, best balance) Sonnet
  • -Use Opus when you need complex architecture analysis or large-scale refactoring Opus
  • -Create a CLAUDE.md file in the project root to provide context for Claude Code CLAUDE.md
  • -Use /compact when context is too long to summarize and save tokens /compact
  • -Subscribe to multiple Claude providers + use aliases → automatic failover when one provider fails

Need more help?

Our support team is ready to assist you

$

Prices are shown in USD

Picked from your location (Chile). You can change it anytime from the language button in the top bar, or pick one below.