9.1. Using Claude Code with Backend.AI GO¶
Claude Code is Anthropic's official CLI tool for agentic coding. By connecting it to Backend.AI GO's Continuum Router, you can use any model—local or cloud—as Claude Code's backend, all from your terminal.
How It Works¶

The Continuum Router includes an Anthropic API compatibility layer that performs bidirectional format conversion between the Anthropic Messages API and the internal model routing. This means Claude Code can talk to Backend.AI GO natively, without any adapter or proxy.
graph LR
A[Claude Code] -->|Anthropic API| B[Continuum Router]
B -->|Route| C[Local Model]
B -->|Route| D[Cloud Model] - Claude Code sends requests using the Anthropic Messages API format.
- Continuum Router receives the request on its
/anthropicendpoint and converts it to the appropriate backend format. - The response is converted back to the Anthropic API format and returned to Claude Code.
Prerequisites¶
Before you begin, make sure you have:
- Backend.AI GO installed and running
- Claude Code installed (
npm install -g @anthropic-ai/claude-code) - At least one model available—either a local model loaded in Backend.AI GO or a cloud provider configured
Setup¶
1. Enable the TCP Server and Find Your Port¶

To expose the Continuum Router's port for external clients like Claude Code, go to the API page in the sidebar and enable the TCP Server toggle. You can also change the port there. The default port is 38080.
Port Numbers
The Anthropic-compatible endpoint (/anthropic) runs on the same port as the Continuum Router (default 38080). This is separate from the OpenAI-compatible endpoint at port 8000.
2. Connect Claude Code¶
Run Claude Code with two environment variables pointing it to your local Continuum Router:
ANTHROPIC_BASE_URL— Points to the Continuum Router's Anthropic-compatible endpoint.ANTHROPIC_API_KEY— Set to an empty string. Authentication is handled locally by Backend.AI GO, so no API key is needed.
Make It Permanent
Add these environment variables to your shell profile (~/.bashrc, ~/.zshrc, etc.) so you don't have to type them every time:
3. Choose a Model¶
Use the --model flag to specify which model Claude Code should use. The model name must match a model available in your Backend.AI GO instance.
Use any cloud model you've configured in Backend.AI GO's Cloud Integration settings.
Scenarios¶
Offline Coding with Full Privacy¶
By pointing Claude Code at a local model, you can code entirely offline. This is ideal for air-gapped environments, sensitive codebases, or when you simply want full privacy—no data leaves your machine.
Unified Access to Cloud Models¶
Instead of configuring individual API keys for each cloud provider in Claude Code, route all requests through Backend.AI GO. Set up your cloud providers once in Backend.AI GO's Cloud Integration, then access any of them by changing the --model flag.
Seamless Model Switching¶
Since all models—local and cloud—are available through the same endpoint, you can switch between them instantly by changing the --model flag. No reconfiguration or environment variable changes needed.
Troubleshooting¶
| Problem | Solution |
|---|---|
Connection refused | Make sure Backend.AI GO is running and the TCP server is enabled in the API page. Check the port number there as well. |
Model not found | Verify the model name matches exactly what's listed in Backend.AI GO. For local models, ensure the model is loaded. |
| Slow responses with local models | Local inference speed depends on your hardware. Try a smaller model or check that GPU acceleration is enabled in Engine settings. |
Related Pages¶
- Continuum Router & API — Technical details on the API gateway
- Cloud Integration — Set up cloud model providers
- Running Models — Load and manage local models