Claude Code

Use Vtrix API as the backend for Claude Code to access more AI models and better pricing.

Claude Code is Anthropic's official command-line AI coding assistant. By configuring Vtrix API, you can use GPT-4, Claude, Gemini, and many other models.

Prerequisites

  • Node.js 18 or higher

  • SeaCloud API key (create one in Settings)

1

Install Claude Code

Install Claude Code CLI using npm:

npm install -g @anthropic-ai/claude-code

Or install using shell script (macOS/Linux):

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

Configure Vtrix API

Vtrix provides two configuration methods: global config file or environment variables. Config file method is recommended.

Create global config file ~/.claude/settings.json:

mkdir -p ~/.claude
vim ~/.claude/settings.json

Config file content:

πŸ“„ ~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://cloud.vtrix.ai/llm/",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "claude-sonnet-4-5"
  }
}

πŸ’‘Get these config parameters: Go to Vtrix β†’ Models page β†’ Select a model (e.g., Claude Sonnet 4.5) β†’ Click "API" tab β†’ Copy config parameters

Using Environment Variables

Add the following to your shell profile:

πŸ“„ ~/.bashrc or ~/.zshrc

# Vtrix API Configuration
export ANTHROPIC_BASE_URL="https://cloud.vtrix.ai/llm/"
export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxxxxxxxxxxxxxxx"
export ANTHROPIC_MODEL="claude-sonnet-4-5"
3

Switch Models

You can change the ANTHROPIC_MODEL variable anytime to switch models. Vtrix supports all major AI models:

Model Type
Recommended Model
Features

Performance

claude-opus-4-5

Best reasoning, complex tasks

Standard

claude-sonnet-4-5

Daily development, balanced

Cost-Effective

gemini-3-pro-preview

Fast response, low cost

Update model (modify config file or environment variable):

πŸ“„ ~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://cloud.vtrix.ai/llm/",
    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxxxxxxxxxxxxxx",
    "ANTHROPIC_MODEL": "gemini-3-pro-preview"  // Change this
  }
}
4

Start Your Session

Navigate to your project directory and start Claude Code:

cd /path/to/your/project
claude

You are now connected! Any prompt you send will be routed through Vtrix.

Verify Configuration

Run the /status command in Claude Code to verify your connection:

> /status
Auth token: ANTHROPIC_AUTH_TOKEN
Base URL: https://openresty-gateway.api.seaart.ai
Model: claude-sonnet-4-5

You can also check the SeaCloud Activity Dashboard to see your requests in real-time:

# Open in browser
open https://cloud.seaart.ai/en/usage

Troubleshooting

Error: API Error: Connection error

Cause: Single ToDo task is too large, causing execution timeout

Solution: Tell Claude Code to break down tasks into smaller steps

> Please break this task into smaller steps, do one small change at a time
Mac Error: env: node: No such file or directory

Cause: Node.js environment not properly loaded in current terminal session

Solution:

# Reload nvm environment
\. "$HOME/.nvm/nvm.sh"

# Then start Claude Code again
claude
Error: API Error: 400 tools.3.custom.input_examples: Extra inputs are not permitted

Cause: Official Claude Code bug, will be fixed in next version update

Temporary Solution:

# Delete cache file
rm ~/.claude/statsig/statsig.cached.evaluations

# Then you must close and start a new session

# Do not continue using in the same session
Other Configuration Issues

Solution:

  • Check if environment variables are correctly set (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL)

  • Verify API key format is correct (starts with sk-)

  • Ensure chosen model supports tool calling feature

  • Check if account has sufficient credits: View balance

Need Help? If you encounter issues integrating Claude Code, check the full API documentation or contact our support team.

Last updated