Developer Guide · Claude Code

Use Claude Code with a Custom API Endpoint

Yes—Claude Code can work through a custom LLM gateway by configuring its API endpoint. This is a task-focused walkthrough; for complete installation, persistent configuration, and troubleshooting, use the full VoyageAge Claude Code documentation.

terminalclaude-code.env
export ANTHROPIC_BASE_URL="https://api.voyageage.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_VOYAGEAGE_API_KEY"
export ANTHROPIC_MODEL="claude-opus-5"

claude
Gateway configuredhttps://api.voyageage.com

Claude Code Custom API Setup in 30 Seconds

Use a temporary terminal configuration first. It is easy to test and disappears when the shell closes.

  1. 01

    Create a VoyageAge API key

    Sign up, open API Keys, and create a key for this Claude Code setup.

  2. 02

    Set the VoyageAge endpoint

    Point ANTHROPIC_BASE_URL to https://api.voyageage.com.

  3. 03

    Add the authentication token

    Set ANTHROPIC_AUTH_TOKEN to your VoyageAge API key.

  4. 04

    Select a supported model

    Set ANTHROPIC_MODEL to a current VoyageAge model ID such as claude-opus-5.

  5. 05

    Start Claude Code and verify

    Run claude, send a simple read-only prompt, and confirm the request in VoyageAge Console.

How the Gateway Connection Works

Developer toolClaude Code
Custom endpointVoyageAge API Gateway
Model targetSupported Claude Model

Your Claude Code workflow stays the same; the API request is routed through the VoyageAge gateway.

VoyageAge is an independent third-party AI API gateway and is not affiliated with Anthropic.

Configure the VoyageAge Claude Endpoint

These examples use the same endpoint and model metadata as the VoyageAge product documentation. Replace only the placeholder with your own API key.

bash

macOS / Linux

export ANTHROPIC_BASE_URL="https://api.voyageage.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_VOYAGEAGE_API_KEY"
export ANTHROPIC_MODEL="claude-opus-5"
claude
powershell

Windows PowerShell

$env:ANTHROPIC_BASE_URL = "https://api.voyageage.com"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_VOYAGEAGE_API_KEY"
$env:ANTHROPIC_MODEL = "claude-opus-5"
claude

Need persistent shell settings, Windows CMD, Git Bash, restore steps, or installation help? Read the full Claude Code documentation.

VariablePurpose
ANTHROPIC_BASE_URLRoutes Claude Code requests to the configured Anthropic-compatible gateway.
ANTHROPIC_AUTH_TOKENAuthenticates the gateway request with your VoyageAge API key.
ANTHROPIC_MODELSelects the supported VoyageAge model ID used for the main Claude Code request.

Use a model ID supported by VoyageAge. The example is claude-opus-5; verify current availability through https://api.voyageage.com/v1/models or your account before relying on it in production.

How to Verify Claude Code Is Using VoyageAge

Test in a disposable project directory before applying persistent settings.

  1. 1

    Open the same terminal where you set the temporary environment variables.

  2. 2

    Run claude in a test directory and send a simple prompt such as “List files without modifying anything.”

  3. 3

    Confirm Claude Code returns a normal response using the model you selected.

  4. 4

    Check VoyageAge Console for a matching Anthropic-compatible request and model entry.

The VoyageAge status page reports service health; it is not an individual request debugger.

Fix the Most Common Setup Issues

Start with the current shell environment, then confirm the endpoint, key, and model ID.

401 or authentication error

Confirm ANTHROPIC_AUTH_TOKEN is present in the current shell, the key is active, and no whitespace was copied with it.

404 or connection error

Check ANTHROPIC_BASE_URL character by character. Use https://api.voyageage.com without appending /v1/messages.

Model not found

Copy a current model ID from https://api.voyageage.com/v1/models, update ANTHROPIC_MODEL, then restart Claude Code.

Claude Code uses the previous endpoint

Print ANTHROPIC_BASE_URL in the current terminal. Restart the shell after changing a persistent environment variable.

Works in one terminal but not another

Temporary environment variables belong only to the shell session where they were set. Configure the second terminal or use the persistent setup in the full docs.

Need deeper troubleshooting? Open the full docs

Why Use VoyageAge with Claude Code?

Centralized API Access

Use one VoyageAge key workflow for supported gateway requests.

Supported Claude Models

Choose from the current Claude model IDs available to your VoyageAge account.

Unified Billing

Manage eligible Claude and other model usage through one VoyageAge account.

Developer-Friendly Gateway

Keep a terminal-based coding workflow with concise, environment-driven configuration.

Claude Code Custom API FAQ

01

Can Claude Code use a custom API endpoint?

Yes. Anthropic documents LLM gateway configuration with ANTHROPIC_BASE_URL and gateway authentication. The gateway must support the request behavior Claude Code needs.

02

What does ANTHROPIC_BASE_URL do?

It changes the base destination used for Anthropic-format requests. For VoyageAge, use the base URL shown in the configuration examples and do not append /v1/messages.

03

Can I use VoyageAge with Claude Code?

Yes. Configure the VoyageAge Anthropic-compatible base URL, your VoyageAge key in ANTHROPIC_AUTH_TOKEN, and a supported model ID.

04

How do I configure Claude Code on Windows?

In PowerShell, set the three $env: variables shown above in the same terminal, then run claude. Those temporary values end when the terminal closes.

05

Why am I getting an authentication error?

The common causes are a missing ANTHROPIC_AUTH_TOKEN, an inactive API key, copied whitespace, or launching Claude Code from a different terminal session.

06

Where can I find the full VoyageAge Claude Code documentation?

Open the Claude Code CLI section in VoyageAge Docs for installation, Windows CMD, persistent configuration, restore steps, and extended troubleshooting.

Connect Claude Code to VoyageAge

Create an API key, set the custom endpoint in your current shell, and verify one request before saving the configuration permanently.

Need help?Chat on Discord