Voided.to voided.to

Claude Code on a custom API gateway: what one turn actually costs

Thread
#1
[Image: claude-code-gateway.gif]

Claude Code talks to whatever ANTHROPIC_BASE_URL points at. Point it at a gateway and the tool, the models and the workflow stay the same. Only the bill changes.

Shell
 
Code:
export ANTHROPIC_BASE_URL="https://api.uplinkswitch.com/v1"
export ANTHROPIC_AUTH_TOKEN="sk-uplink-live-..."
claude

Set ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY, not both.

Or keep it in ~/.claude/settings.json
 
Code:
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.uplinkswitch.com/v1",
    "ANTHROPIC_AUTH_TOKEN": "sk-uplink-live-...",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

Check the key before you start: curl https://api.uplinkswitch.com/v1/models -H "x-api-key: $ANTHROPIC_AUTH_TOKEN"

What one turn costs
I recorded one real turn on 2026-10-16: Sonnet 5.5, "add type hints and a docstring to slugify.py", 4 requests, 64 seconds. It cost $0.0551. The same tokens at Anthropic's list price: $0.0981.
 
  • Claude Opus 5.5: $2.10 / $6 per million tokens (list $4 / $20)
  • Claude Sonnet 5.5: $1.20 / $3 (list $2 / $10)
  • Claude Haiku 5.5: $0.06 / $0.15 (list $0.10 / $0.50)

To go back to your normal login: unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN. Longer breakdown with cached tokens: what Claude Code costs on API billing.

 
[Image: btn-free.gif] [Image: btn-guide-claude-code.gif]
 
▢▢▢▢■ UplinkSwitch
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
83 AI models · 1 API key
Claude · GPT · Gemini 70% under list · Uncensored too
【 GET $1 FREE ➜ 】 【 LIVE PRICES ➜ 】
Telegram @artificialthru
Reply