Using Claude Code
Run Anthropic's Claude Code CLI through Troviale — install it, point three environment variables at the gateway, and pay from your Troviale wallet.
Claude Code is Anthropic's command-line coding agent. You can run it through Troviale so it bills against your Troviale wallet instead of a separate Anthropic account — no code changes, just three environment variables.
Before you start
You need credits and an API key. If you don't have them yet, follow Getting access first:
- Contact the team for a redeem code.
- Redeem it on your wallet to add credits.
- Generate a key on the API keys page.
1. Install Claude Code
Claude Code runs on macOS and Linux. On Windows, install it inside WSL (Windows Subsystem for Linux) — it isn't supported in native Windows shells.
wsl --installThen, inside your WSL/Ubuntu terminal (or directly on macOS/Linux):
curl -fsSL https://claude.ai/install.sh | bash2. Point Claude Code at Troviale
Claude Code reads its endpoint and credentials from three values. Set them either as environment variables (Option A) or in Claude Code's settings file (Option B) — you only need one.
Option A — environment variables
In your CMD or WSL terminal, set these three:
export ANTHROPIC_BASE_URL=https://api.troviale.com
export ANTHROPIC_AUTH_TOKEN=sk-your-troviale-key
export ANTHROPIC_API_KEY=What each one does:
ANTHROPIC_BASE_URL— routes Claude Code to the Troviale gateway instead ofapi.anthropic.com.ANTHROPIC_AUTH_TOKEN— your Troviale API key (starts withsk-). This is sent as the bearer token on every request.ANTHROPIC_API_KEY— left empty on purpose. With it unset, Claude Code usesANTHROPIC_AUTH_TOKENfor auth instead of looking for an Anthropic key.
Make it stick
Running export only sets the variables for the current terminal session.
Add the three lines to the end of your ~/.bashrc (then run source ~/.bashrc) so every new shell is configured automatically.
Option B — Claude Code settings file
Instead of exports, you can put the same three values in Claude Code's settings file. Claude Code applies them on every run, so there's nothing to set per session.
Create or edit ~/.claude/settings.json and add an env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.troviale.com",
"ANTHROPIC_AUTH_TOKEN": "sk-your-troviale-key",
"ANTHROPIC_API_KEY": ""
}
}~/.claude/settings.jsonapplies to every project.- A
.claude/settings.jsonin a project root applies to just that project (and overrides the user-level file) — handy if you want different keys per project.
The same notes apply: ANTHROPIC_AUTH_TOKEN is your Troviale key, and
ANTHROPIC_API_KEY stays empty so Claude Code authenticates with the token.
3. Run Claude Code
Start it from any project directory:
claudeClaude Code now sends its requests through Troviale, drawing down your wallet balance as you go.
4. Confirm it's billing through Troviale
Check both ends so you know it's wired correctly:
- In the Claude Code terminal, run
/costto see token usage and spend for the session. The consumption should tick up as you use it. - On Troviale, open the usage page — requests from Claude Code appear there, and your wallet balance decreases accordingly.
If usage shows up in both places, you're set. If requests fail, double-check
that ANTHROPIC_BASE_URL has no trailing slash and that your key is active on
the API keys page.