Short on time? Here's the tool I built for exactly this — AACGCP 2 Billion Plus Tokens (Windows):
- One big green button. No commands, no config files. Press it and Claude Code, Codex, Gemini CLI and Antigravity CLI switch to free API quotas you signed up for yourself.
- Press Stop and their settings are restored byte for byte. Go back to exactly how things were, anytime.
- Built-in list of 186 providers (about 2.395 billion verified first-day free tokens across the list, not the amount for one user). It recommends a provider, opens the official sign-up page and checks your key when you paste it.
- A small meter shows on-duty total, used, remaining and current speed — matching the per-request log and the provider's dashboard.
- When one provider runs out, the next takes over; when all are used up, your tool gets a clear "try again later" within seconds instead of hanging.
- 52 plugins keep working on free tokens (Gmail, Google Drive, Slack, GitHub and more).
- Keys stay encrypted on your own PC. Signed files, 0 detections in a Kaspersky scan (2026-11-27), no admin rights needed. Interface in 40 languages.
- Foolproof to install, one click to run. Even complete beginners can use it.
- Honest limits: answers come from the free models you connect, not from Claude; it doesn't work with the Claude desktop app, claude.ai or ChatGPT on the web.
If you'd like to try it, comment "want" and we'll send you the link.
If you prefer to understand how it works and set it up yourself, read on.
You're in the middle of a refactor, and your AI coding assistant says you've reached your usage limit. You can wait for the reset, pay for more. Or, if you have API quotas from other providers (many offer free tiers), send your tool's requests there instead.
This post explains how that works under the hood and how to set it up safely.
1. Why this is possible at all
Command-line AI tools don't talk to "the AI" directly. They send HTTP requests in a specific format to a base URL:
- Claude Code speaks the Anthropic Messages format.
- Codex speaks the OpenAI format.
If you change the base URL, the tool sends its requests to another endpoint. The receiving service must support the same API format and the specific features your tool uses, such as streaming and tool calling.
That's also why chat apps you sign in to (the Claude desktop app, claude.ai, ChatGPT on the web) can't be redirected: they're tied to your account, and you don't control where their requests go.
2. Claude Code: the base URL setting
Claude Code reads environment variables such as:
ANTHROPIC_BASE_URL=http://127.0.0.1:8787
ANTHROPIC_AUTH_TOKEN=your-key-for-that-endpoint
You can set them in your shell, or in the env section of Claude Code's settings.json. Restart Claude Code after changing them.
3. Codex: a custom model provider
Codex lets you define providers in ~/.codex/config.toml:
model_provider = "local"
[model_providers.local]
name = "Local endpoint"
base_url = "http://127.0.0.1:8787/v1"
env_key = "LOCAL_ENDPOINT_KEY"
Then set the LOCAL_ENDPOINT_KEY environment variable and pick a model the endpoint serves.
4. What a local endpoint in the middle does
If your free quotas are spread across several providers that each use their own format, a small local service can sit in between:
- Accept requests in the format your tool speaks (Anthropic or OpenAI style).
- Translate them to the format of the provider that will answer.
- Choose a provider that still has quota left.
- Translate the answer back so your tool sees a normal response.
Two details matter a lot in practice:
- Request size. Coding agents send very large requests (lots of context). Some free tiers have a small per-request limit and will reject them. A good middle layer detects this quickly and tells you clearly, instead of retrying forever.
- Running out. When a provider returns HTTP 429 or a quota error, move to the next one. When all are exhausted, return a clear error (for example 429 with a "try again later" message) right away, so your tool doesn't hang.
A simplified fallback loop:
for provider in providers_with_quota_left():
resp = provider.send(translate(request, provider.format))
if resp.ok:
return translate_back(resp)
if resp.is_quota_or_rate_limit():
mark_exhausted(provider)
continue
if resp.is_request_too_large():
return clear_error("Request too large for this free source; add a provider with a bigger limit.")
return clear_error("All free quotas are used up. Please try again later.", status=429)
5. Do it safely
- Back up your tool's config before you change it, and restore it exactly afterwards. Compare the restored file with the backup byte for byte, so your normal setup is never left half-changed.
- Keep keys local. Store API keys encrypted on your own machine; don't paste them into shared files or repos.
-
Bind to 127.0.0.1, not
0.0.0.0, so the endpoint isn't reachable from your network. - Read each provider's terms. Free quotas, limits and reset times are set by the provider and can change. Some free tiers may use your data for training, so check before sending private code.
- Measure. Log tokens per request and compare with the provider's dashboard now and then; if the numbers don't match, something is wrong.
6. Be honest with yourself about quality
When you point Claude Code at another endpoint, the answers come from that provider's model, not from Claude. Free models can be great for routine edits, tests and explanations; keep the hardest tasks for the model you trust most.
This article was written with the help of AI and reviewed by the author for accuracy.
About the author: AACGCP GROUP.
Top comments (0)