$1 Test Budget, 2 Variables: Claude Code on a Relay
01 / Make $1 your test budget, not a pricing promise
You do not need a monthly commitment to test a coding assistant through a relay. Start with a personal spending limit of $1, one small repository, and one narrow task. That $1 is a suggested experiment budget, not a quoted deposit minimum, guaranteed task price, or automatic account cap.
CheapRelay is a pay-as-you-go AI API relay with no monthly fee or subscription. Billing follows real token usage, including cache reads and writes. Your actual cost depends on the selected model, the context sent, the generated output, and the applicable token rates.
Sign up for CheapRelay at cheapapirelay.com, check the current pricing and funding requirements, and create an API key. If the available funding options exceed your budget, stop there rather than stretching it for a trial.
02 / Prepare Claude Code without exposing your key
This walkthrough assumes Claude Code is already installed and that you can open a terminal. The commands below use macOS, Linux, or a compatible shell such as Bash in WSL. They configure the current terminal session; they do not permanently change every terminal on your computer.
Before proceeding, check CheapRelay’s current Claude Code instructions for any account-specific requirements. Also inspect your existing Claude Code configuration. An old API key, saved login, or project setting can create authentication conflicts or send requests through an unintended account.
Treat the relay key like a password. Do not put it in a repository, paste it into an issue, or include it in a screenshot. Shell commands can be retained in terminal history, so use your shell’s private-history method or another secure local secret-entry method when entering the real value.
03 / Set the relay address and token in two variables
Claude Code uses Anthropic-specific environment variables for this connection. In the terminal where you will launch it, set the base address:
export ANTHROPIC_BASE_URL="https://api.cheapapirelay.com"
Then set the authentication token, replacing the placeholder locally with your CheapRelay API key:
export ANTHROPIC_AUTH_TOKEN="YOUR_CHEAPRELAY_API_KEY"
Those are the two connection variables. Use the relay’s root address here, not its OpenAI-compatible /v1 route or Gemini-native /v1beta route. Those routes serve other client interfaces; they are not interchangeable Claude Code configuration values.
Launch Claude Code from that same terminal by running claude. Environment variables pass to programs started from that shell. An already-open editor or a separate terminal will not automatically inherit this session’s new values.
04 / Choose a model before giving it repository work
Open Claude Code’s model selector with /model and check the relay’s supported model identifiers. For a small experiment, inspect the current rates for Claude Haiku 4.5. Do not assume a display name is also the exact API identifier, or that Claude Code’s default model is the least expensive available option.
If your Claude Code version allows a custom identifier, use the exact value supplied by CheapRelay. If selection fails, resolve that before asking the assistant to scan files. A successful launch alone does not prove that a billable model request will work.
05 / Spend the first request on one file, not the whole project
Open a small test repository without credentials or sensitive data. Give the assistant a tightly bounded prompt: “Read only README.md. Suggest three wording improvements in fewer than 150 words. Do not edit files or run commands.”
This limits the requested work, but it does not cap billed tokens. Claude Code may send system instructions, conversation context, and other material beyond the visible prompt. Output length is only one part of the receipt.
- ■ Check your usage dashboard after the request, allowing for any reporting delay.
- ■ Compare input, output, and cache-related charges where shown.
- ■ Use a hard spending limit if the service offers one; do not assume one exists.
- ■ Stop before larger tasks if you cannot reconcile the usage with your budget.
06 / Fix connection errors before increasing the workload
For authentication errors, check the key and conflicting credentials. For model errors, check the exact identifier. For connection errors, verify the base address and current compatibility instructions. Avoid repeated blind retries: successful requests can consume tokens even when the overall task remains unfinished.
Once the first receipt makes sense, increase task size gradually. The useful milestone is not merely connecting in two variables. It is knowing where requests go, which model handles them, and what your first small task actually costs.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-28 | Coding agents, cheaply | EN | $1 Budget: Catch a Coding Agent Loop Before It Spends Spot repeated tool calls, rising token use and stalled edits early, then stop and restart a coding agent within a tiny budget. |
| 2026-10-28 | Coding agents, cheaply | EN | $1 Budget: Codex and Claude Code on One Tiny Repo Compare Codex and Claude Code on one tiny Python repo with a $1 planning budget, identical tasks, local tests, and honest cost tracking. |
| 2026-10-28 | Coding agents, cheaply | EN | $0.50 task budget: Claude Code, fewer file reads A beginner workflow for limiting Claude Code's file reads, narrowing searches, and checking token spending on a tiny pay-as-you-go budget. |
| 2026-10-28 | Coding agents, cheaply | EN | Save Tokens: 6 Claude Code Commands for 2026 A practical 2026 guide to /compact, /clear, /context and other Claude Code commands that reduce waste on pay-as-you-go billing. |
| 2026-10-28 | Coding agents, cheaply | EN | $2 Budget: Connect a VS Code Assistant Connect a VS Code assistant to an OpenAI-compatible API, test one small task, and track token costs with a $2 planning budget. |
| 2026-10-28 | Coding agents, cheaply | EN | 36,000 to 12,000 Tokens: Trim Your Agent's Context A tiny-budget walkthrough for cutting coding-agent context: select files, limit logs, compact history, and check actual token charges. |