<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abel Chang</title>
    <description>The latest articles on DEV Community by Abel Chang (@abel_chang).</description>
    <link>https://dev.to/abel_chang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4268075%2F21415add-0b85-49d0-b42f-1572e63a5c46.jpg</url>
      <title>DEV Community: Abel Chang</title>
      <link>https://dev.to/abel_chang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abel_chang"/>
    <language>en</language>
    <item>
      <title>Keep coding when your AI tool hits its limit: pointing Claude Code and Codex at other API endpoints</title>
      <dc:creator>Abel Chang</dc:creator>
      <pubDate>Tue, 01 Dec 2026 00:28:39 +0000</pubDate>
      <link>https://dev.to/abel_chang/keep-coding-when-your-ai-tool-hits-its-limit-pointing-claude-code-and-codex-at-other-api-endpoints-1n6j</link>
      <guid>https://dev.to/abel_chang/keep-coding-when-your-ai-tool-hits-its-limit-pointing-claude-code-and-codex-at-other-api-endpoints-1n6j</guid>
      <description>&lt;p&gt;&lt;strong&gt;Short on time? Here's the tool I built for exactly this — AACGCP 2 Billion Plus Tokens (Windows):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One big green button.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Press Stop and their settings are restored byte for byte.&lt;/strong&gt; Go back to exactly how things were, anytime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in list of 186 providers&lt;/strong&gt; (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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A small meter&lt;/strong&gt; shows on-duty total, used, remaining and current speed — matching the per-request log and the provider's dashboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When one provider runs out, the next takes over;&lt;/strong&gt; when all are used up, your tool gets a clear "try again later" within seconds instead of hanging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;52 plugins keep working on free tokens&lt;/strong&gt; (Gmail, Google Drive, Slack, GitHub and more).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keys stay encrypted on your own PC.&lt;/strong&gt; Signed files, 0 detections in a Kaspersky scan (2026-11-27), no admin rights needed. Interface in 40 languages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foolproof to install, one click to run.&lt;/strong&gt; Even complete beginners can use it.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you'd like to try it, comment "want" and we'll send you the link.&lt;/p&gt;

&lt;p&gt;If you prefer to understand how it works and set it up yourself, read on.&lt;/p&gt;




&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;This post explains how that works under the hood and how to set it up safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why this is possible at all
&lt;/h2&gt;

&lt;p&gt;Command-line AI tools don't talk to "the AI" directly. They send HTTP requests in a specific format to a &lt;strong&gt;base URL&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code speaks the &lt;strong&gt;Anthropic Messages&lt;/strong&gt; format.&lt;/li&gt;
&lt;li&gt;Codex speaks the &lt;strong&gt;OpenAI&lt;/strong&gt; format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;That's also why &lt;strong&gt;chat apps you sign in to&lt;/strong&gt; (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.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Claude Code: the base URL setting
&lt;/h2&gt;

&lt;p&gt;Claude Code reads environment variables such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;ANTHROPIC_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:8787
&lt;span class="nv"&gt;ANTHROPIC_AUTH_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-key-for-that-endpoint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can set them in your shell, or in the &lt;code&gt;env&lt;/code&gt; section of Claude Code's &lt;code&gt;settings.json&lt;/code&gt;. Restart Claude Code after changing them.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Codex: a custom model provider
&lt;/h2&gt;

&lt;p&gt;Codex lets you define providers in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="na"&gt;model_provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"local"&lt;/span&gt;

&lt;span class="k"&gt;[model_providers.local]&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Local endpoint"&lt;/span&gt;
&lt;span class="na"&gt;base_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"http://127.0.0.1:8787/v1"&lt;/span&gt;
&lt;span class="na"&gt;env_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"LOCAL_ENDPOINT_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then set the &lt;code&gt;LOCAL_ENDPOINT_KEY&lt;/code&gt; environment variable and pick a model the endpoint serves.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What a local endpoint in the middle does
&lt;/h2&gt;

&lt;p&gt;If your free quotas are spread across several providers that each use their own format, a small local service can sit in between:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Accept&lt;/strong&gt; requests in the format your tool speaks (Anthropic or OpenAI style).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translate&lt;/strong&gt; them to the format of the provider that will answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose a provider&lt;/strong&gt; that still has quota left.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translate the answer back&lt;/strong&gt; so your tool sees a normal response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two details matter a lot in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Request size.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running out.&lt;/strong&gt; When a provider returns HTTP 429 or a quota error, move to the next one. When &lt;em&gt;all&lt;/em&gt; are exhausted, return a clear error (for example 429 with a "try again later" message) right away, so your tool doesn't hang.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simplified fallback loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;providers_with_quota_left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;translate_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_quota_or_rate_limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;mark_exhausted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_request_too_large&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;clear_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Request too large for this free source; add a provider with a bigger limit."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;clear_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"All free quotas are used up. Please try again later."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;429&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Do it safely
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Back up your tool's config before you change it, and restore it exactly afterwards.&lt;/strong&gt; Compare the restored file with the backup byte for byte, so your normal setup is never left half-changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep keys local.&lt;/strong&gt; Store API keys encrypted on your own machine; don't paste them into shared files or repos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bind to 127.0.0.1&lt;/strong&gt;, not &lt;code&gt;0.0.0.0&lt;/code&gt;, so the endpoint isn't reachable from your network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read each provider's terms.&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure.&lt;/strong&gt; Log tokens per request and compare with the provider's dashboard now and then; if the numbers don't match, something is wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Be honest with yourself about quality
&lt;/h2&gt;

&lt;p&gt;When you point Claude Code at another endpoint, &lt;strong&gt;the answers come from that provider's model, not from Claude&lt;/strong&gt;. Free models can be great for routine edits, tests and explanations; keep the hardest tasks for the model you trust most.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was written with the help of AI and reviewed by the author for accuracy.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;About the author: AACGCP GROUP.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
