<?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: APIClaw</title>
    <description>The latest articles on DEV Community by APIClaw (@apiclawhq).</description>
    <link>https://dev.to/apiclawhq</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%2F4207149%2F50ad3676-f283-4276-866d-3a25823f5517.png</url>
      <title>DEV Community: APIClaw</title>
      <link>https://dev.to/apiclawhq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/apiclawhq"/>
    <language>en</language>
    <item>
      <title>Pointing Cursor, [CC], and Codex at a different API endpoint (what actually breaks)</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Sun, 25 Oct 2026 19:48:00 +0000</pubDate>
      <link>https://dev.to/apiclawhq/pointing-cursor-cc-and-codex-at-a-different-api-endpoint-what-actually-breaks-3hh4</link>
      <guid>https://dev.to/apiclawhq/pointing-cursor-cc-and-codex-at-a-different-api-endpoint-what-actually-breaks-3hh4</guid>
      <description>&lt;p&gt;Swapping the model behind a coding tool is usually described as a one-line config change. It is, but only for tools that were built with a provider abstraction in the first place. Here is what differs across the popular ones, and the four things that break in practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The common shape
&lt;/h2&gt;

&lt;p&gt;Almost every tool that supports a custom endpoint wants the same three values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Base URL&lt;/strong&gt; — the root that paths like &lt;code&gt;/v1/chat/completions&lt;/code&gt; are appended to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API key&lt;/strong&gt; — often any non-empty string, since the gateway does the real authentication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model name&lt;/strong&gt; — the exact identifier the gateway expects, not the marketing name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The failures cluster in the details of those three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cursor
&lt;/h2&gt;

&lt;p&gt;Cursor's custom API mode lives in Settings, under the OpenAI API section. You set an override base URL and a key, then add models manually by name. Two things trip people up: the model list is not discovered automatically, so a typo in a model identifier looks like an authentication failure; and Cursor sends requests shaped for the OpenAI schema, so a gateway must accept that schema rather than only the native provider format.&lt;/p&gt;

&lt;h2&gt;
  
  
  [CC]
&lt;/h2&gt;

&lt;p&gt;[CC] reads two environment variables: &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; and &lt;code&gt;ANTHROPIC_AUTH_TOKEN&lt;/code&gt;. Set both, then launch normally. The frequent mistake is setting only the base URL and leaving the tool to use its stored login, which takes precedence. Explicitly exporting the token is what makes the override take effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Codex CLI
&lt;/h2&gt;

&lt;p&gt;Codex reads a config file (&lt;code&gt;~/.codex/config.toml&lt;/code&gt;) with a model provider block. You define a provider with a &lt;code&gt;base_url&lt;/code&gt; and &lt;code&gt;env_key&lt;/code&gt;, then select it as the active model provider. The &lt;code&gt;env_key&lt;/code&gt; names an environment variable rather than holding the secret, so the key never lands in the config file — useful, and a common source of confusion when the variable is unset.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four things that actually break
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Trailing slashes and version prefixes.&lt;/strong&gt; &lt;code&gt;https://host/v1&lt;/code&gt; and &lt;code&gt;https://host&lt;/code&gt; are different base URLs. Most tools append &lt;code&gt;/v1/chat/completions&lt;/code&gt; themselves, so including &lt;code&gt;/v1&lt;/code&gt; in the base gives you &lt;code&gt;/v1/v1/...&lt;/code&gt; and a 404 that looks like an outage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Model identifiers.&lt;/strong&gt; &lt;code&gt;claude-sonnet-4&lt;/code&gt; is not a universal name. If the gateway expects a namespaced form, the marketing name fails. Check the gateway's model list rather than guessing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Streaming format.&lt;/strong&gt; A gateway can accept chat completions but emit stream chunks in a slightly different envelope. The tool then hangs waiting for a delta that never arrives, or prints nothing until the response completes. This is the hardest failure to diagnose because the HTTP status is 200.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Tool-call schema.&lt;/strong&gt; Coding agents depend heavily on tool calls. If the gateway translates them imperfectly, the agent loops or silently stops using tools. You notice this as "the agent got dumber," not as an error.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to test in five minutes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Send one non-streaming request with &lt;code&gt;curl&lt;/code&gt; to the base URL and confirm a normal JSON completion.&lt;/li&gt;
&lt;li&gt;Repeat with &lt;code&gt;"stream": true&lt;/code&gt; and confirm chunks arrive incrementally rather than all at once.&lt;/li&gt;
&lt;li&gt;Send one request containing a tool definition and confirm the response has a &lt;code&gt;tool_calls&lt;/code&gt; block.&lt;/li&gt;
&lt;li&gt;Only then wire it into the tool.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Doing those three curls first separates a config problem from a gateway problem before you spend an hour blaming the editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the base URL matters for pricing too
&lt;/h2&gt;

&lt;p&gt;A gateway is not only a proxy. It decides how you are billed, and that choice is more consequential for coding agents than for chat. Token metering makes the cost of a long agent run knowable only after it finishes. A per-request allowance bounds it by the number of steps you permit.&lt;/p&gt;

&lt;p&gt;The gateway I use for this is &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;APIClaw&lt;/a&gt; — [OI]-compatible, so the three steps above work unchanged, and priced per request rather than per token. The per-tool setup notes for Cursor, [CC], Codex and about twenty others are in the &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;. Whatever gateway you pick, run the three curls before you trust the config.&lt;/p&gt;

</description>
      <category>api</category>
      <category>coding</category>
      <category>llm</category>
      <category>tools</category>
    </item>
    <item>
      <title>What actually triggers Claude's 5-hour limit (and the four ways around it)</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Sun, 25 Oct 2026 19:05:33 +0000</pubDate>
      <link>https://dev.to/apiclawhq/what-actually-triggers-claudes-5-hour-limit-and-the-four-ways-around-it-194p</link>
      <guid>https://dev.to/apiclawhq/what-actually-triggers-claudes-5-hour-limit-and-the-four-ways-around-it-194p</guid>
      <description>&lt;p&gt;If you have hit "You've reached your usage limit. You can resume in X hours" in the middle of a refactor, the useful question is not how many messages you get. It is what the clock is measuring and when it started.&lt;/p&gt;

&lt;h2&gt;
  
  
  The window is rolling, not daily
&lt;/h2&gt;

&lt;p&gt;The five-hour limit is a rolling window. The timer starts at the timestamp of your &lt;strong&gt;first message in a usage session&lt;/strong&gt;, not at midnight and not at the moment you get blocked.&lt;/p&gt;

&lt;p&gt;Two consequences follow, and they explain most of the confusion:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two people on identical plans hit their limits at completely different clock times.&lt;/li&gt;
&lt;li&gt;The five hours you wait is measured from when you &lt;em&gt;started&lt;/em&gt;, so a burst that begins at 09:00 unlocks at 14:00 even if you hit the wall at 09:40.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also a separate weekly cap that resets independently of the five-hour window. Hitting the session limit does not mean you have exhausted the weekly allowance, and vice versa.&lt;/p&gt;

&lt;h2&gt;
  
  
  It is not a fixed message count
&lt;/h2&gt;

&lt;p&gt;Anthropic does not publish a universal message quota. Usage is weighted by several factors that compound:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conversation length&lt;/strong&gt; — longer threads consume more of the allowance, because each turn carries the accumulated context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model choice&lt;/strong&gt; — the larger models draw down the allowance faster than the smaller ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attachments and file contents&lt;/strong&gt; — reading a large file into context counts against you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tools, effort level, and artifacts&lt;/strong&gt; — extended thinking and tool loops are not free.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Published estimates put Claude Pro at roughly 45 messages per five-hour window, Max 5x around 225, and Max 20x around 900. Treat those as order-of-magnitude figures that vary with everything above, not as published guarantees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why agent sessions drain it so much faster than chat
&lt;/h2&gt;

&lt;p&gt;This is the part that surprises people, and it is mechanical rather than mysterious.&lt;/p&gt;

&lt;p&gt;A chat turn sends a prompt and gets a reply. The context is short and does not grow much.&lt;/p&gt;

&lt;p&gt;An agent loop is recursive. Every step re-sends the accumulated context: the same files, the same tool outputs, the same instructions. A fifty-step task can re-read the same context fifty times. Consumption grows with task length in a way a single chat turn never does, which is why one long coding session can consume an allowance that would have covered a week of chat.&lt;/p&gt;

&lt;p&gt;If you want to see where the allowance actually goes, the two levers that matter most are conversation length and model choice, in that order.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four options when you hit the wall
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Wait for the reset.&lt;/strong&gt; Free, and correct if the task can wait. The clock is already running from your session start, so check the reset time before assuming it is five hours away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Shrink the context.&lt;/strong&gt; Start a fresh thread rather than continuing a long one. Summarise tool output instead of pasting it. Cap the number of steps a single agent task may take, so a runaway loop cannot drain the window in one go. This is the highest-leverage fix and it costs nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Use usage credits if you have them.&lt;/strong&gt; When credits are enabled and available, sessions continue past the included limit rather than pausing. You keep working, and you pay for the overage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Move that workload to an API key with a different limit model.&lt;/strong&gt; This is the option people underweight, because it changes the shape of the constraint rather than the size of it. A subscription caps a &lt;em&gt;window of time&lt;/em&gt;. An API key meters &lt;em&gt;tokens&lt;/em&gt; or &lt;em&gt;requests&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing between token-metered and request-metered APIs
&lt;/h2&gt;

&lt;p&gt;Both are legitimate; they fail differently.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;token-metered&lt;/strong&gt; API gives you a large ceiling and an unpredictable bill. The cost of a task is only knowable after it finishes, which makes budgeting retrospective and per-project attribution a reconstruction exercise.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;request-metered&lt;/strong&gt; API bounds cost by the number of steps you allow. That converts budgeting from an accounting problem into a configuration decision, which is where it belongs if you are running agents rather than chatting.&lt;/p&gt;

&lt;p&gt;For a coding agent that runs long tasks, the second model is usually the better fit. For occasional chat and short jobs, token metering is often cheaper.&lt;/p&gt;

&lt;p&gt;Whichever you pick, check these before committing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens exactly at the ceiling: a clean &lt;code&gt;429&lt;/code&gt; with &lt;code&gt;Retry-After&lt;/code&gt;, or a dropped stream? A mid-stream drop loses the step and can leave a half-applied edit on disk.&lt;/li&gt;
&lt;li&gt;Are limits enforced per key or per account? Per-account limits let one runaway agent starve every other job.&lt;/li&gt;
&lt;li&gt;Can you issue separate keys per client or environment, so attribution is a query rather than a reconciliation?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I actually use
&lt;/h2&gt;

&lt;p&gt;I run coding agents rather than chat, so the window model was the wrong shape for my workload and I moved that work to a request-metered gateway. The one I use is &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;APIClaw&lt;/a&gt; — [OI]-compatible, priced per request rather than per token, and it took a base-URL change to adopt. If you stay on a subscription, the context-shrinking advice above is the part worth doing regardless.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The five-hour limit is a rolling window measured from your first message, weighted by conversation length, model, and attachments rather than a flat message count. Agents drain it fast because they re-send context every step. The fixes, in order of cost: shrink context, cap agent steps, use credits, or change the limit model entirely.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Rate limits, burst budgets, and why agent workloads hit ceilings chat never touches</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Sun, 25 Oct 2026 18:36:10 +0000</pubDate>
      <link>https://dev.to/apiclawhq/rate-limits-burst-budgets-and-why-agent-workloads-hit-ceilings-chat-never-touches-4i9g</link>
      <guid>https://dev.to/apiclawhq/rate-limits-burst-budgets-and-why-agent-workloads-hit-ceilings-chat-never-touches-4i9g</guid>
      <description>&lt;p&gt;Every "we hit a limit" story in an AI API account has the same shape: a ceiling that is generous for chat and hostile for agents. The difference is not traffic volume. It is the shape of the workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chat is short and bursty, agents are long and recursive
&lt;/h2&gt;

&lt;p&gt;A chat turn sends a prompt and gets an answer. The context is whatever the user typed. Token consumption is bounded by the length of the conversation, and the conversation is usually short.&lt;/p&gt;

&lt;p&gt;An agent loop is different in a way that matters for budgeting. Every step re-sends the accumulated context. A fifty-step task re-reads the same files, the same tool outputs, the same instructions fifty times. Token consumption grows roughly with the &lt;em&gt;square&lt;/em&gt; of task length in the worst case, because each step carries everything before it.&lt;/p&gt;

&lt;p&gt;That is the mechanism behind the ceiling surprise. The account looked fine all month on chat traffic, then one long-running coding agent drained the quota in an afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a ceiling actually does to an agent
&lt;/h2&gt;

&lt;p&gt;The failure is not "request rejected." The failure is "session degrades."&lt;/p&gt;

&lt;p&gt;When a token-metered API starts refusing calls mid-task, the agent does not roll back cleanly. It loses the step it was on. Depending on the framework, it either retries the same oversized context (making the problem worse), truncates history and loses coherence, or dies and leaves a half-applied refactor on disk. All three are worse than the request never having started.&lt;/p&gt;

&lt;p&gt;A rate limit that returns a clean 429 with &lt;code&gt;Retry-After&lt;/code&gt; is survivable. A mid-stream drop is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Budgeting as a design decision, not a post-mortem
&lt;/h2&gt;

&lt;p&gt;Under token metering, the cost of a task is only knowable after it finishes. You find out what the run cost by reading the bill. That makes budgeting a retrospective exercise, and it makes per-client attribution a spreadsheet reconstruction problem.&lt;/p&gt;

&lt;p&gt;Under a per-request allowance, the cost is bounded by the number of steps you permit. That is a number you choose in advance. It converts an accounting problem into a configuration decision, which is where it belongs.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist for evaluating a gateway against agent workloads
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does it speak the [OI] schema, including streaming and tool calls, so your framework needs only a base-URL change?&lt;/li&gt;
&lt;li&gt;Are request limits published per plan, or only token limits? Token-only limits are the ones that ambush you.&lt;/li&gt;
&lt;li&gt;What happens exactly at the ceiling: clean 429 with &lt;code&gt;Retry-After&lt;/code&gt;, or a dropped stream?&lt;/li&gt;
&lt;li&gt;Can you issue separate keys per client or per environment, so attribution is a query rather than a reconciliation?&lt;/li&gt;
&lt;li&gt;Is the limit enforced per key or per account? Per-account limits let one runaway agent starve every other job.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Practical mitigation, whichever pricing model you use
&lt;/h2&gt;

&lt;p&gt;Cap the step count per task. Summarise context rather than re-sending it verbatim. Queue long jobs instead of firing them concurrently. Treat the ceiling as a design input rather than an operational surprise.&lt;/p&gt;

&lt;p&gt;The setup notes for the gateway I use are in the &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;APIClaw documentation&lt;/a&gt; — it is [OI]-compatible and priced per request rather than per token, which is what made the budgeting above a configuration decision instead of a monthly surprise.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Running coding agents on a flat-rate API instead of a token meter</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Sun, 25 Oct 2026 18:25:41 +0000</pubDate>
      <link>https://dev.to/apiclawhq/running-coding-agents-on-a-flat-rate-api-instead-of-a-token-meter-2d95</link>
      <guid>https://dev.to/apiclawhq/running-coding-agents-on-a-flat-rate-api-instead-of-a-token-meter-2d95</guid>
      <description>&lt;p&gt;An agent loop re-sends its context on every step, so token consumption grows with&lt;br&gt;
task length in a way a single chat turn never does. When that growth meets a hard&lt;br&gt;
hourly ceiling the session degrades rather than ending — usually mid-refactor, which&lt;br&gt;
is the worst possible moment.&lt;/p&gt;

&lt;p&gt;A per-request allowance fixes the failure mode, because the budget becomes a count&lt;br&gt;
you can plan against before you start rather than a number you watch slide.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to check before switching
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does the gateway speak the [OI] schema, including streaming and tool calls?&lt;/li&gt;
&lt;li&gt;Are request limits published per plan, not just token limits?&lt;/li&gt;
&lt;li&gt;Can you issue separate keys per client, so attribution is not a spreadsheet exercise?&lt;/li&gt;
&lt;li&gt;What happens at the ceiling — a clean 429 with Retry-After, or a mid-stream drop?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why flat-rate helps agents specifically
&lt;/h2&gt;

&lt;p&gt;Chat workloads are bursty but short. Agent workloads are long and recursive: a&lt;br&gt;
fifty-step task can re-read the same context fifty times. Under token metering the&lt;br&gt;
cost of a task is only knowable after it finishes, which makes budgeting a&lt;br&gt;
post-mortem exercise. Under a request allowance the cost is bounded by the number of&lt;br&gt;
steps you allow, which is a design decision you make up front.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;The gateway is [OI]-compatible, so most agent frameworks need only a base-URL&lt;br&gt;
change. Setup notes per tool are in the &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;APIClaw documentation&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
