Integrations
Claude Code
Point Claude Code at Token Harbor manually — Base URL, API key, and exact steps. One key, every model, no CLI required.
Claude Code + Token Harbor
Anthropic's terminal coding agent. Route it through Token Harbor to use every model with a single key.
Get a thk_… key from /dashboard/api-keys (a free account works), then:
Claude Code reads its config from ~/.claude/settings.json. Add an env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://tokenharbor.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_thk_KEY"
}
}
Then start a new terminal and run claude. That's it — Claude Code now routes
through Token Harbor. To pick a specific model, use /model inside Claude Code.
Prefer one command? The tokenharbor CLI configures Claude Code
automatically (and can undo it).
If a large call is paused
When one call could cost more than half of your balance, Token Harbor pauses it and asks you to confirm. You'll see an error that starts with "This call is estimated at about $…, more than half of your $… balance". (Why this happens: Confirming a large call.)
Claude Code can't add the confirmation field to its requests, but it can send a
header. Add ANTHROPIC_CUSTOM_HEADERS to the same env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://tokenharbor.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_thk_KEY",
"ANTHROPIC_CUSTOM_HEADERS": "x-th-confirm-spend: true"
}
}
Then restart Claude Code. This turns the check off for Claude Code, so a single call can use most of your balance.
To keep the check on, lower the estimate instead. Claude Code asks for up to
64,000 output tokens per call, and the estimate counts all of them. Add
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "16000" to the env block, or switch to a
lower-priced model with /model.