Connect Claude Code to PromptUnit
Claude Code doesn't have a settings screen for this, so it's two lines typed into a text file instead of clicking a toggle. Still copy-paste, no real coding involved. Works exactly the same whether you run Claude Code in its own terminal window or inside VS Code's built-in terminal.
Get your PromptUnit key
If you haven't already, sign up free at PromptUnit (no credit card). Once you're in, go to your Dashboard and open API Keys. Copy the key shown there, you'll need it in a moment.
Open a terminal
If you already run Claude Code from a terminal, use that same one. If you use it inside VS Code, open a terminal there instead (menu: Terminal → New Terminal). Either way works identically.
Type two lines, then press enter after each
On Mac or Linux, paste these one at a time (replace your_key_here with the key from Step 1):
Line 1
export ANTHROPIC_BASE_URL="https://www.promptunit.ai/api/proxy/anthropic"Line 2
export ANTHROPIC_AUTH_TOKEN="your_key_here"On Windows, use these instead (in PowerShell):
Line 1
$env:ANTHROPIC_BASE_URL="https://www.promptunit.ai/api/proxy/anthropic"Line 2
$env:ANTHROPIC_AUTH_TOKEN="your_key_here"Run Claude Code as usual, in that same terminal window
As long as you don't close that terminal window, Claude Code will keep using PromptUnit. If you close it and open a new one, you'd need to run those two lines again, unless you make it permanent (next step).
Optional: make it permanent
If you don't want to retype those lines every time, add the same two export lines (Mac/Linux) to a file called ~/.zshrc or ~/.bashrc in your home folder, then restart your terminal. This step is genuinely optional, everything already works without it, it just saves you retyping.
Watch your savings
Open your PromptUnit Dashboard any time to see exactly how much you've saved, request by request. If you signed up through the free trial, your first $5 in real savings costs nothing, no card needed.
If something doesn't look right
Make sure there are no typos in the two lines, especially the quotation marks. If you closed your terminal and things stopped working, that's expected unless you did the optional permanent step, just run the two lines again. Still stuck? Reach out and we'll sort it out with you directly.
Quick reference
The address you'll paste in, if you need it again:
https://www.promptunit.ai/api/proxy/anthropic