<?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>A Four-Check Debugging Method for OpenAI-Compatible AI APIs</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Fri, 30 Oct 2026 05:13:33 +0000</pubDate>
      <link>https://dev.to/apiclawhq/a-four-check-debugging-method-for-openai-compatible-ai-apis-20g3</link>
      <guid>https://dev.to/apiclawhq/a-four-check-debugging-method-for-openai-compatible-ai-apis-20g3</guid>
      <description>&lt;h2&gt;
  
  
  Debugging an OpenAI-compatible gateway: separate transport from quota
&lt;/h2&gt;

&lt;p&gt;When a coding agent fails against an OpenAI-compatible API, I first separate four variables: URL construction, authentication, request shape, and quota. Changing the model before checking those variables makes the diagnosis slower.&lt;/p&gt;

&lt;h3&gt;
  
  
  Start with the smallest request
&lt;/h3&gt;

&lt;p&gt;Use the versioned API root documented by the gateway, then send one system message and one user message. Log the method, path, status, model ID, request ID, and latency; redact the key. A 401 usually means the key was not loaded, while a 404 often means the SDK appended a path to the wrong base URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the budget separately
&lt;/h3&gt;

&lt;p&gt;A request-metered plan behaves differently from per-token billing. APIClaw is a flat-rate, OpenAI-compatible AI API gateway with a monthly plan and daily request quotas rather than a per-token bill. Its free tier includes 50 requests without a card. The &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;APIClaw docs&lt;/a&gt; describe the OpenAI-compatible base URL and client setup.&lt;/p&gt;

&lt;p&gt;For an agent, count requests, retries, and model weighting independently. A retry loop can exhaust a daily quota even when prompts are short. APIClaw documents weighted requests for heavier models and quota reset timing in its &lt;a href="https://apiclaw.biz/flat-rate-openai-compatible-api/" rel="noopener noreferrer"&gt;flat-rate API guide&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Add features one at a time
&lt;/h3&gt;

&lt;p&gt;After the minimal non-streaming call works, add streaming, tools, and structured output individually. Compare the same prompt with streaming disabled; this isolates server-sent-event handling from authentication and payload validation. Bound retries for 429 and 5xx responses, but do not retry a malformed request or a 401.&lt;/p&gt;

&lt;p&gt;This method produces a reproducible failure instead of a vague “the model is broken” report: URL, auth, payload, transport, and quota each get their own test.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why a shared API gateway key beats three consumer seats for a team of three</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 20:34:11 +0000</pubDate>
      <link>https://dev.to/apiclawhq/why-a-shared-api-gateway-key-beats-three-consumer-seats-for-a-team-of-three-h4k</link>
      <guid>https://dev.to/apiclawhq/why-a-shared-api-gateway-key-beats-three-consumer-seats-for-a-team-of-three-h4k</guid>
      <description>&lt;p&gt;Three developers, one AI budget line. The obvious solution is three consumer subscriptions — everyone gets their own seat, everyone gets their own quota, nobody argues. The less obvious problem is that a subscription seat and a shared API key solve different problems, and only one of them survives contact with a team.&lt;/p&gt;

&lt;p&gt;This is the arithmetic I did when I moved a three-person team off seat-based plans onto a single gateway key.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a seat actually buys
&lt;/h2&gt;

&lt;p&gt;A consumer subscription for an AI coding tool is a per-person product. Seat, account, session history, quota. When three people each buy one, you pay three times for three private pools of capacity, and the pools do not talk to each other.&lt;/p&gt;

&lt;p&gt;That last part is the issue. Work does not distribute evenly. On any given Tuesday one developer is running a refactor agent across 60 files while the other two are writing tests. Seat A's ceiling fires at 11am; seats B and C are at 20% utilisation. You can see the waste on the invoice and you cannot move it.&lt;/p&gt;

&lt;p&gt;Published seat prices for the mainstream coding plans land anywhere from $20 to $200 per person per month depending on tier. Three seats is therefore somewhere between $60 and $600 a month — call it $60 for the cheap tier and $300 for the tier where the agent actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same team, metered per request
&lt;/h2&gt;

&lt;p&gt;Here is the measurement side. Over a month, the three of us generated these weighted daily averages from gateway logs — one row per API request, weighted by model (Claude Sonnet class counts 2, Opus and GPT-6 Sol class count 3, DeepSeek 1):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Developer&lt;/th&gt;
&lt;th&gt;Weighted requests/day&lt;/th&gt;
&lt;th&gt;What they do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;agent-driven refactors, Sonnet class&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;test generation and review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;85&lt;/td&gt;
&lt;td&gt;scripts and docs, DeepSeek for cheap work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;300&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;9,000 weighted requests/month&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now price that against a request-metered gateway. APIClaw's tiers are monthly with a daily request quota that resets at 00:00 UTC, and the one relevant to this workload is Max at $59 for 1,500 requests a day — 20% utilisation, 80% headroom.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Monthly cost&lt;/th&gt;
&lt;th&gt;Aggregate quota&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3 × cheap seat ($20)&lt;/td&gt;
&lt;td&gt;$60&lt;/td&gt;
&lt;td&gt;3 private pools, none shared&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 × working seat ($100)&lt;/td&gt;
&lt;td&gt;$300&lt;/td&gt;
&lt;td&gt;3 private pools, none shared&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 × shared key, Max tier&lt;/td&gt;
&lt;td&gt;$59&lt;/td&gt;
&lt;td&gt;1,500 weighted requests/day, pooled&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The shared key costs less than the cheap tier and one fifth of the working tier, and the quota is pooled rather than partitioned. When developer A needs 360 requests on refactor day — three times their average, which is a realistic spike and not a pathological one — they draw from a pool of 1,500 instead of hitting a personal ceiling at 500 that nobody else can top up.&lt;/p&gt;

&lt;p&gt;$59 split three ways is $19.67 a person. That is the honest number, and it is the one to put in the budget spreadsheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The catch: a shared key is a shared blast radius
&lt;/h2&gt;

&lt;p&gt;The pooling argument is easy. The operational cost of one key is real and it is not small, so here is what you have to build before you share anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name the key after the human, not the team.&lt;/strong&gt; One key per developer, all on the same account. That gives you per-person revocation — when someone leaves, you revoke one key and their &lt;code&gt;gpt-6-sol&lt;/code&gt; access is gone by the next request, without rotating anything for the other two. A single shared secret string means everyone rotates in a bad hour.&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="c"&gt;# one key per person, same account, so per-person revocation is a one-click&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;APICLAW_KEY_ALICE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;APICLAW_KEY_BOB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Attribute before you optimise.&lt;/strong&gt; A gateway that logs per-request model and outcome answers "who used 40% of the pool" in week three. A seat-based tool usually will not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set the ceiling below the pool, not at it.&lt;/strong&gt; If the pool is 1,500, agree a soft 900. The ceiling's job is to catch a runaway loop, not to enforce fairness between humans.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep the model choice in the code, not in a mood.&lt;/strong&gt; A shared pool means one person's frontier-model habit is visible to everyone. Routing cheap work — summarising, docstrings, lint fixes — to a weight-1 model and reserving weight-3 models for planning is a two-line client change and the biggest lever on how long the pool lasts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the single key genuinely wins beyond price
&lt;/h2&gt;

&lt;p&gt;The argument that convinced my colleagues was not the invoice. It was that a gateway key is a &lt;em&gt;plumbing&lt;/em&gt; decision, and a seat is a &lt;em&gt;product&lt;/em&gt; decision.&lt;/p&gt;

&lt;p&gt;With one key you can point any OpenAI-compatible tool at the same endpoint and get the same models without a new purchase: Continue in VS Code, Cline, Kilo Code, a shell script, a CI job that summarises a diff. Seat-based plans cover the tool they ship. If your team's work is spread across three editors and a couple of scripts, the seat model sends you shopping; the gateway model does not.&lt;/p&gt;

&lt;p&gt;APIClaw is the flat-rate version of that: one key at &lt;code&gt;https://apiclaw.biz/v1&lt;/code&gt; covering Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM and the rest, request-metered rather than token-metered, and it also speaks Anthropic Messages for tools that expect that shape. The practical point for a small team is that the quota is an account-level pool with published request weights, so the "who is using the shared budget" question has a factual answer — see &lt;a href="https://apiclaw.biz/flat-rate-ai-api/" rel="noopener noreferrer"&gt;how the weights and tiers work&lt;/a&gt; before you size anything.&lt;/p&gt;

&lt;p&gt;Payment is &lt;a href="https://apiclaw.biz/pay-ai-api-with-crypto/" rel="noopener noreferrer"&gt;crypto via NOWPayments&lt;/a&gt;, which is worth naming early rather than discovering at checkout, and support is on Telegram rather than a ticket queue.&lt;/p&gt;

&lt;h2&gt;
  
  
  When a seat is the better buy
&lt;/h2&gt;

&lt;p&gt;Three cases, honestly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One person, one tool, heavy use.&lt;/strong&gt; A single $100 seat beats a $59 pool if that person alone would use 1,400 requests a day. The pool only wins when it is shared.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You need the tool's own agent features.&lt;/strong&gt; Seat plans bundle vendor-specific completions and agent modes that bring-your-own-key does not reproduce.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You need zero ops.&lt;/strong&gt; A shared key is one more thing to revoke, rotate and attribute. Sometimes that is not worth $241 a month.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But if the team is three people with varied workloads, spread across more than one editor, and one of you is regularly hitting a ceiling while the others are not, a request-metered gateway key is the structurally correct shape. Pooled capacity, one line on the invoice, one endpoint to point everything at. &lt;a href="https://apiclaw.biz/one-api-key-all-models/" rel="noopener noreferrer"&gt;The one-key setup&lt;/a&gt; covers what the endpoint accepts and how to lay out keys per person without sharing a secret.&lt;/p&gt;

&lt;p&gt;Run the numbers against your own logs first: sum your team's weighted requests per day, pick the tier that leaves 50–80% headroom, and compare that to seats × price. If the pool wins by less than 20%, stay on seats — the operational overhead is not free.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>devtools</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I metered my own coding agent for a week: 97% of the tokens went to re-reading</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 20:18:50 +0000</pubDate>
      <link>https://dev.to/apiclawhq/i-metered-my-own-coding-agent-for-a-week-97-of-the-tokens-went-to-re-reading-39d0</link>
      <guid>https://dev.to/apiclawhq/i-metered-my-own-coding-agent-for-a-week-97-of-the-tokens-went-to-re-reading-39d0</guid>
      <description>&lt;p&gt;An agent turn is not a message. It is the whole conversation so far, re-sent. I spent a week logging per-turn &lt;code&gt;usage&lt;/code&gt; objects off the OpenAI-compatible endpoint my agent talks to, and the thing that surprised me was not the total — it was the ratio. Prompt tokens were 97% of everything the agent consumed, and output tokens were 3%.&lt;/p&gt;

&lt;p&gt;That is not a rounding artefact. It is what an agent loop does by construction, and once you see the arithmetic you stop optimising the wrong term.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I logged
&lt;/h2&gt;

&lt;p&gt;Every response from a chat completions call carries a usage block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prompt_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;13800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"completion_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;450&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"total_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;14250&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I appended one row per turn — &lt;code&gt;{session_id, turn_index, prompt_tokens, completion_tokens, tool_name, wall_ms}&lt;/code&gt; — to a JSONL file. Nothing fancy. Roughly 15 minutes of work with the &lt;code&gt;http.client&lt;/code&gt; in stdlib, because the client I use lets me set a response hook.&lt;/p&gt;

&lt;p&gt;The point of logging per turn rather than per request-day is that the daily total hides the shape. A day with 40 turns across 4 short sessions and a day with 40 turns in one long session cost wildly different amounts, and the billing dashboard shows you the same number.&lt;/p&gt;

&lt;h2&gt;
  
  
  The growth curve
&lt;/h2&gt;

&lt;p&gt;Here is the arithmetic that matters. Take a session with a 9,000-token base context (system prompt plus tool schemas), each tool result adding 1,200 tokens to the transcript, and a 450-token assistant reply per turn.&lt;/p&gt;

&lt;p&gt;Prompt tokens at turn &lt;em&gt;n&lt;/em&gt;: &lt;code&gt;9000 + 1200 × (n − 1)&lt;/code&gt;.&lt;br&gt;
Output tokens at turn &lt;em&gt;n&lt;/em&gt;: &lt;code&gt;450&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Turns&lt;/th&gt;
&lt;th&gt;Prompt tokens&lt;/th&gt;
&lt;th&gt;Completion tokens&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;Tokens/turn&lt;/th&gt;
&lt;th&gt;Cost @ $3/$15 per M&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;9,000&lt;/td&gt;
&lt;td&gt;450&lt;/td&gt;
&lt;td&gt;9,450&lt;/td&gt;
&lt;td&gt;9,450&lt;/td&gt;
&lt;td&gt;$0.0338&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;30,600&lt;/td&gt;
&lt;td&gt;1,350&lt;/td&gt;
&lt;td&gt;31,950&lt;/td&gt;
&lt;td&gt;10,650&lt;/td&gt;
&lt;td&gt;$0.1120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;72,000&lt;/td&gt;
&lt;td&gt;2,700&lt;/td&gt;
&lt;td&gt;74,700&lt;/td&gt;
&lt;td&gt;12,450&lt;/td&gt;
&lt;td&gt;$0.2565&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;187,200&lt;/td&gt;
&lt;td&gt;5,400&lt;/td&gt;
&lt;td&gt;192,600&lt;/td&gt;
&lt;td&gt;16,050&lt;/td&gt;
&lt;td&gt;$0.6426&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;585,000&lt;/td&gt;
&lt;td&gt;11,250&lt;/td&gt;
&lt;td&gt;596,250&lt;/td&gt;
&lt;td&gt;23,850&lt;/td&gt;
&lt;td&gt;$1.9238&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;1,296,000&lt;/td&gt;
&lt;td&gt;18,000&lt;/td&gt;
&lt;td&gt;1,314,000&lt;/td&gt;
&lt;td&gt;32,850&lt;/td&gt;
&lt;td&gt;$4.1580&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The sums are just arithmetic series: prompt total is &lt;code&gt;n × 9000 + 1200 × n(n−1)/2&lt;/code&gt;. At n=40 that is 1,296,000 tokens to produce 18,000 tokens of actual text — a 72:1 ratio. The cost column uses $3 per million input and $15 per million output, roughly frontier-tier rates at time of writing; substitute your model's numbers, the shape does not change.&lt;/p&gt;

&lt;p&gt;Two things fall out of that table:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tokens per turn rises with session length.&lt;/strong&gt; It goes 9,450 → 32,850 between turn 1 and turn 40. A dashboard that reports average tokens per request across a month is averaging a distribution that has no stable mean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output price barely matters.&lt;/strong&gt; At 12 turns, prompt tokens are 97% of volume but only 87% of cost — because output is 5× the input rate. Even at that multiplier, you are paying mostly to re-read.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a week looked like in requests
&lt;/h2&gt;

&lt;p&gt;The unit my gateway meters is the request, not the token, so the same data has to be re-expressed. A representative session in my logs was 12 turns. At 48 sessions a week:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;48 × 12 = &lt;strong&gt;576 requests per week&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;576 × 16,050 average tokens = &lt;strong&gt;9.24M tokens per week&lt;/strong&gt;, of which 9.0M were prompt&lt;/li&gt;
&lt;li&gt;weighted for a 2× model like the Sonnet class: &lt;strong&gt;1,152 weighted requests per week&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compare that to a daily request allowance: 1,152 weighted over seven days is 165 a day on average — comfortably inside a 500/day tier even with a 3× spike on a heavy debugging day. The same workload on a token meter at those rates is $30.84 a week, or about $133 a month if the pattern holds through four and a half weeks. That number is why I started looking at request-metered gateways in the first place: my monthly token bill was tracking my agent's verbosity, not my output.&lt;/p&gt;

&lt;p&gt;The break-even is worth computing before you argue about either model. At $0.64 per 12-turn session, a $39 flat tier pays for itself at about 61 sessions a month. Sixty-one sessions is three a working day. If you run fewer, per-token is cheaper and you should stay on it — honestly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things that actually reduced the number
&lt;/h2&gt;

&lt;p&gt;Not vibes — measured deltas on the prompt side, which is where 97% of the tokens are.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Trim tool results before they enter the transcript.&lt;/strong&gt; A grep that returns 400 lines stays in context for every subsequent turn. Truncating to the 40 relevant lines cost me nothing in task success and cut the 1,200-token average tool result to about 500. Rerun the 40-turn series with that one change: &lt;code&gt;40 × 9000 + 500 × (40 × 39 / 2) = 360,000 + 390,000 = 750,000&lt;/code&gt; prompt tokens against 1,296,000 — a 42% cut on the same task, from one truncation rule.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start a fresh session per task, not per project.&lt;/strong&gt; Four 10-turn sessions on the same work cost &lt;code&gt;4 × (10 × 9000 + 500 × 45) = 450,000&lt;/code&gt; prompt tokens instead of 750,000, because the quadratic growth term is split into four shallower curves. You also get better tool selection out of a shorter transcript, which is a side effect I did not expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Cap the loop, don't cap the tokens.&lt;/strong&gt; A &lt;code&gt;max_turns&lt;/code&gt; guard at 25 refuses the pathological 80-turn session that produces nothing. Output token limits do not help here — the runaway is on the input side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I meter requests now
&lt;/h2&gt;

&lt;p&gt;Once the ratio is 97/3, the per-token invoice is charging you for a number you can only influence indirectly, through context hygiene. A request-metered gateway charges for the shape instead: one turn is one request. The cognitive load drops, and so does the variance — my worst week and my best week are within 15% of each other now, where the token bill used to swing 3×.&lt;/p&gt;

&lt;p&gt;APIClaw runs on that model: a flat monthly tier metered in requests at &lt;code&gt;https://apiclaw.biz/v1&lt;/code&gt;, with heavier models counting for more against the daily pool (Claude Sonnet class 2×, Opus and GPT-6 Sol class 3×, DeepSeek 1×). That weighting is the honest part of the design — it admits the 72:1 ratio exists — and &lt;a href="https://apiclaw.biz/flat-rate-ai-api/" rel="noopener noreferrer"&gt;the tier table&lt;/a&gt; is the thing to check against your own request count, not against a token estimate.&lt;/p&gt;

&lt;p&gt;If you want to reproduce this: log &lt;code&gt;usage&lt;/code&gt; per turn for one week, compute &lt;code&gt;prompt_total / completion_total&lt;/code&gt;, and see whether your workload looks like mine. If the ratio is above 20:1, you are paying for re-reads and should optimise the transcript, not the prompt wording. &lt;a href="https://apiclaw.biz/compare/" rel="noopener noreferrer"&gt;The comparison page&lt;/a&gt; puts the token-metered and request-metered shapes side by side if you want the pricing arithmetic spelled out.&lt;/p&gt;

&lt;p&gt;The one-number summary I took away from the week: my agent wrote 18,000 tokens of thinking per long session and read 1.3 million to do it. Everything I have changed since is aimed at the 1.3 million.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>coding</category>
      <category>llm</category>
    </item>
    <item>
      <title>Pointing VS Code Continue and Windsurf at a custom OpenAI-compatible base URL</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 20:15:50 +0000</pubDate>
      <link>https://dev.to/apiclawhq/pointing-vs-code-continue-and-windsurf-at-a-custom-openai-compatible-base-url-525j</link>
      <guid>https://dev.to/apiclawhq/pointing-vs-code-continue-and-windsurf-at-a-custom-openai-compatible-base-url-525j</guid>
      <description>&lt;p&gt;Pointing an editor at a custom OpenAI-compatible endpoint is documented as a settings-screen operation. In practice the settings screen is the part that fails silently, and the extension's config file is the part that decides what actually gets sent. These are the steps that hold up on VS Code and on Windsurf, plus the four failures I keep seeing in other people's bug reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prove the endpoint before you touch the editor
&lt;/h2&gt;

&lt;p&gt;Every "the extension won't connect" report I have read this year was really an endpoint problem wearing an editor costume. Test the endpoint from a shell first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://apiclaw.biz/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"say ok"}],"max_tokens":16}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three outcomes tell you everything. &lt;code&gt;401&lt;/code&gt; means the key did not arrive. &lt;code&gt;404&lt;/code&gt; almost always means the path is doubled — a base URL of &lt;code&gt;.../v1&lt;/code&gt; plus a client that appends &lt;code&gt;/v1/chat/completions&lt;/code&gt; gives you &lt;code&gt;/v1/v1/chat/completions&lt;/code&gt;. A &lt;code&gt;400&lt;/code&gt; naming the model means you typed a shortened model id instead of the full one your account can use; copy it, don't retype it.&lt;/p&gt;

&lt;p&gt;If that curl returns a completion, the remaining problem is local configuration and you can stop suspecting the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continue on VS Code: the whole config
&lt;/h2&gt;

&lt;p&gt;Continue reads &lt;code&gt;~/.continue/config.yaml&lt;/code&gt; (&lt;code&gt;%USERPROFILE%\.continue\config.yaml&lt;/code&gt; on Windows). The minimal working model block looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;APIClaw&lt;/span&gt;
&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1.0.0&lt;/span&gt;
&lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;models&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;APIClaw&lt;/span&gt;
    &lt;span class="na"&gt;provider&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openai&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;YOUR_MODEL_ID&lt;/span&gt;
    &lt;span class="na"&gt;apiBase&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://apiclaw.biz/v1&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;YOUR_API_KEY&lt;/span&gt;
    &lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tool_use&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;image_input&lt;/span&gt;
    &lt;span class="na"&gt;roles&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;chat&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;edit&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;apply&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four details in those twelve lines are the ones that break:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;apiBase&lt;/code&gt;, not &lt;code&gt;baseUrl&lt;/code&gt;.&lt;/strong&gt; A wrong key name is not an error. Continue ignores it, falls back to &lt;code&gt;api.openai.com&lt;/code&gt;, and you get a 401 from a host you never configured.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;capabilities&lt;/code&gt; overrides autodetection.&lt;/strong&gt; Continue guesses capability from model names it recognises. An unfamiliar id gets no &lt;code&gt;tool_use&lt;/code&gt;, and agent mode then answers with prose and never calls a tool — it looks like a broken agent when it is a broken declaration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;roles&lt;/code&gt; decides where the model appears.&lt;/strong&gt; Missing &lt;code&gt;apply&lt;/code&gt; and the Edit pane will appear to do nothing. Missing &lt;code&gt;edit&lt;/code&gt; and you can only chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment variables do not reach the extension host.&lt;/strong&gt; Continue's IDE extensions cannot read your shell env, so exporting the key in &lt;code&gt;.zshrc&lt;/code&gt; accomplishes nothing. Put &lt;code&gt;APICLAW_API_KEY=...&lt;/code&gt; in &lt;code&gt;~/.continue/.env&lt;/code&gt; and reference it through Continue's secret lookup syntax in place of the literal &lt;code&gt;apiKey&lt;/code&gt;. Then restart the IDE — reloading the window is not enough, the extension host caches the config.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Windsurf is a different problem
&lt;/h2&gt;

&lt;p&gt;Windsurf was renamed Devin Desktop in June 2026, and Cascade was removed in September 2026, leaving Devin Local as the only built-in agent. Devin Desktop has no setting for a custom OpenAI-compatible base URL. There is no field to fill in.&lt;/p&gt;

&lt;p&gt;So the gateway is used through an extension, not through the app. Open the Extensions panel — it uses the Open VSX registry, which matters: Roo Code is there, Cline may or may not be depending on your build. Install an OpenAI-compatible coding extension, choose the OpenAI Compatible provider, paste the base URL, the key, and a full model id. Only that extension talks to the gateway. The built-in agent and autocomplete stay on the models the application ships with, which is a feature if you like the app's own completions and a wart if you were hoping to consolidate everything.&lt;/p&gt;

&lt;p&gt;The Windsurf path is written up in &lt;a href="https://apiclaw.biz/docs/windsurf/" rel="noopener noreferrer"&gt;the APIClaw Windsurf notes&lt;/a&gt;, and the VS Code path — including the Copilot Chat option — is in &lt;a href="https://apiclaw.biz/docs/vscode/" rel="noopener noreferrer"&gt;the VS Code guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copilot Chat as a second front end
&lt;/h2&gt;

&lt;p&gt;If you are already inside VS Code, the built-in Copilot Chat can take a custom endpoint: &lt;em&gt;Manage Language Models&lt;/em&gt; from the model picker, then the Custom Endpoint provider. The older "OpenAI Compatible" provider is deprecated, so do not start there. The URL must include the path, not just the host — &lt;code&gt;https://apiclaw.biz/v1/chat/completions&lt;/code&gt;, or &lt;code&gt;/v1/responses&lt;/code&gt; if you set API type to Responses. Bring-your-own-key is enabled by default on Copilot Business and Enterprise, but an admin can switch it off by policy, and it covers chat and agent mode only; inline completions and embeddings stay on the Copilot plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  The failure table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;404 on every request&lt;/td&gt;
&lt;td&gt;path doubled&lt;/td&gt;
&lt;td&gt;base URL ends at &lt;code&gt;/v1&lt;/code&gt;, client appends the rest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401 immediately&lt;/td&gt;
&lt;td&gt;key never loaded&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;.env&lt;/code&gt; file, secret reference, IDE restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400 "model not found"&lt;/td&gt;
&lt;td&gt;shortened id&lt;/td&gt;
&lt;td&gt;copy the full id from the model hub&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent replies, edits nothing&lt;/td&gt;
&lt;td&gt;no &lt;code&gt;tool_use&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;declare capabilities&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit pane inert&lt;/td&gt;
&lt;td&gt;no &lt;code&gt;apply&lt;/code&gt; role&lt;/td&gt;
&lt;td&gt;add it to &lt;code&gt;roles&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why the indirection is worth it
&lt;/h2&gt;

&lt;p&gt;Because these editors send whatever model id you typed, you can route by role: a mid-weight model for edit and tab-adjacent work, a frontier model when the agent is planning. That is only possible when the models arrive through one endpoint. APIClaw is a flat-rate gateway that answers the OpenAI chat completions schema at &lt;code&gt;https://apiclaw.biz/v1&lt;/code&gt;, and it also speaks Anthropic Messages for tools that expect that shape, so a single key covers both generations of tooling — the argument for &lt;a href="https://apiclaw.biz/one-api-key-all-models/" rel="noopener noreferrer"&gt;one key across every model&lt;/a&gt; rather than one subscription per editor. The request is the billing unit, heavier models count more against the daily pool, and there is no per-token line on the invoice to reverse-engineer afterwards.&lt;/p&gt;

&lt;p&gt;Start with the curl. Nine times out of ten, that is the whole bug.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
      <category>vscode</category>
    </item>
    <item>
      <title>kluster.ai's API Is Going Away — A Migration Guide and 5 Alternatives</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 17:59:56 +0000</pubDate>
      <link>https://dev.to/apiclawhq/klusterais-api-is-going-away-a-migration-guide-and-5-alternatives-p59</link>
      <guid>https://dev.to/apiclawhq/klusterais-api-is-going-away-a-migration-guide-and-5-alternatives-p59</guid>
      <description>&lt;h1&gt;
  
  
  kluster.ai's API Is Going Away — A Migration Guide and 5 Alternatives
&lt;/h1&gt;

&lt;p&gt;If you still have &lt;code&gt;kluster.ai&lt;/code&gt; in a config file somewhere, this is the post to read end to end.&lt;/p&gt;

&lt;p&gt;As of late October 2026, &lt;code&gt;kluster.ai&lt;/code&gt; no longer resolves for us at the DNS level — the inference API, the docs, and the site are gone or unreachable from multiple networks we checked. The company was acquired by &lt;strong&gt;MITO AI&lt;/strong&gt; (announced on LinkedIn and covered by Dealroom), and the AI-video platform consolidated the team and technology. Whatever the public EOL notice said or didn't say, the practical reality is the one that matters for your code: &lt;strong&gt;assume the kluster endpoint can fail without notice. It may already be failing for you.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The good news: migrating off a dead gateway is a 20-minute job when you know what to touch. This post is the exact checklist we use, plus five alternatives compared on the dimensions that actually bite.&lt;/p&gt;

&lt;h2&gt;
  
  
  What breaks when a gateway dies
&lt;/h2&gt;

&lt;p&gt;A gateway API is a thin slice of configuration — but it hides inside everything. Before you switch, inventory these four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The base URL.&lt;/strong&gt; &lt;code&gt;https://api.kluster.ai/v1&lt;/code&gt; (or whatever you hardcoded) lives in environment variables, &lt;code&gt;.env&lt;/code&gt; files, CI secrets, and sometimes in committed code you forgot about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The API key.&lt;/strong&gt; Keys are per-account. If the account is gone, every key is dead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model IDs.&lt;/strong&gt; If you call &lt;code&gt;model: "kluster/..."&lt;/code&gt;, that string breaks the moment the gateway stops routing it — even if you point the base URL somewhere else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provider-specific parameters.&lt;/strong&gt; This is the hidden one. Gateways silently ignore or reject params they don't support (&lt;code&gt;top_k&lt;/code&gt;, &lt;code&gt;repetition_penalty&lt;/code&gt;, custom &lt;code&gt;extra_body&lt;/code&gt; fields). A replacement may accept the request and return &lt;em&gt;different output&lt;/em&gt; because it interprets a param differently. Parameter drift is how "it still works" becomes "it works differently and you didn't notice."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also: &lt;strong&gt;export your logs and billing history before the account dies.&lt;/strong&gt; You will not be able to reconstruct usage retrospectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  The migration checklist
&lt;/h2&gt;

&lt;p&gt;This works for kluster → anything, and for any future gateway death:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inventory every place the base URL and key appear: &lt;code&gt;grep -r "kluster" .&lt;/code&gt; is your friend. Don't forget CI (&lt;code&gt;~/.github/workflows&lt;/code&gt;, GitLab CI, CircleCI), Docker compose files, and &lt;code&gt;.env&lt;/code&gt; files in deploy directories.&lt;/li&gt;
&lt;li&gt;Export what you need: logs, usage, any fine-tuned model artifacts that were stored on their side.&lt;/li&gt;
&lt;li&gt;Pick a replacement (table below), create the account, generate a key.&lt;/li&gt;
&lt;li&gt;Change two things: base URL and API key. Model IDs usually need a mapping step — see the alternatives table.&lt;/li&gt;
&lt;li&gt;Re-run one golden prompt — a request you know the expected output of — and &lt;strong&gt;diff the output&lt;/strong&gt;, don't just check the HTTP status.&lt;/li&gt;
&lt;li&gt;Cut over a non-critical job first. Watch it for a day, then move the real workloads.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's the diff pattern for a Python &lt;code&gt;openai&lt;/code&gt; client:&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="c1"&gt;# before
&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.kluster.ai/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# after
&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.openrouter.ai/api/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And for a raw curl (this is what lives in Claude Code / Cursor configs):&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="c"&gt;# before&lt;/span&gt;
curl https://api.kluster.ai/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"model": "kluster/...", "messages": [...]}'&lt;/span&gt;

&lt;span class="c"&gt;# after — base URL and model id both change&lt;/span&gt;
curl https://openrouter.ai/api/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"model": "anthropic/claude-sonnet", "messages": [...]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Five alternatives, grouped by what you need
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;th&gt;What actually limits you&lt;/th&gt;
&lt;th&gt;Frontier closed models?&lt;/th&gt;
&lt;th&gt;OpenAI-compatible?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;APIClaw&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$19–$129/mo flat&lt;/td&gt;
&lt;td&gt;Daily request count (500–8,000/day), unlimited tokens per request&lt;/td&gt;
&lt;td&gt;Yes — Claude, GPT, Gemini, 100+ models&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenRouter&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pay per token + 5.5% credit fee&lt;/td&gt;
&lt;td&gt;Your balance&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Requesty&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pay per token (+5% processing)&lt;/td&gt;
&lt;td&gt;Your balance&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NanoGPT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Subscription covers open-weight models; closed models billed from prepaid balance&lt;/td&gt;
&lt;td&gt;Weekly token allowance on the sub; balance for the rest&lt;/td&gt;
&lt;td&gt;No subscription includes them&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chutes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Free tier + credits&lt;/td&gt;
&lt;td&gt;Request/day on open-weight models&lt;/td&gt;
&lt;td&gt;Open-weight only&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Cheapest per token / open-weight only
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Chutes&lt;/strong&gt; and &lt;strong&gt;NanoGPT&lt;/strong&gt; both lean open-weight. If your workload was kluster's OSS models and you want minimal cost, these are the familiar trade: cheap or free, but no Claude/GPT/Gemini in the flat subscription.&lt;/p&gt;

&lt;h3&gt;
  
  
  Broadest catalogue
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;OpenRouter&lt;/strong&gt; is the default for a reason — every model, one key, per-token billing. You trade the flat bill for a metered one and a credit fee.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enterprise controls
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Requesty&lt;/strong&gt; adds EU residency options and guardrails on top of the same per-token model. Good when compliance matters more than price.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flat monthly with frontier models
&lt;/h3&gt;

&lt;p&gt;*&lt;em&gt;&lt;a href="https://apiclaw.biz/" rel="noopener noreferrer"&gt;APIClaw&lt;/a&gt; is the one that behaves like kluster's promise *and&lt;/em&gt; keeps a predictable bill: $19–$129/month, your limit is a daily &lt;em&gt;request count&lt;/em&gt;, not a token meter, and it serves Claude, GPT, Gemini and 100+ other models through one OpenAI-compatible endpoint. If you moved to kluster to get away from unpredictable per-token invoices, this keeps that property. The &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;client setup docs&lt;/a&gt; cover Claude Code, Cursor, Codex CLI and the rest.&lt;/p&gt;

&lt;p&gt;One honest caveat for all of them: read the model list before you commit. "OpenAI-compatible" doesn't mean "same catalogue."&lt;/p&gt;

&lt;h2&gt;
  
  
  If your kluster workload was batch jobs
&lt;/h2&gt;

&lt;p&gt;Batch jobs have no human in the loop to absorb a mid-run failure. This is where a gateway death hurts most:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A per-token service fails &lt;strong&gt;gradually&lt;/strong&gt; (balance runs down, requests get slower) — you get warnings.&lt;/li&gt;
&lt;li&gt;A fixed-allowance service fails &lt;strong&gt;sharply&lt;/strong&gt; (daily request cap or account gone → hard 429s) — your batch just dies at whatever offset it reached.&lt;/li&gt;
&lt;li&gt;A flat-daily-allowance service with a bounded count is the closest to "predictable": you know exactly how many requests a batch will consume, so you can size it against the allowance before you start.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whatever you pick, add a wrapper that records the last successful offset and retries from there. Gateway migrations are not the last time you'll need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to test a replacement in 10 minutes
&lt;/h2&gt;

&lt;p&gt;Don't migrate on faith. Run this on the new endpoint before you change anything in production:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One long-context request.&lt;/strong&gt; Push a 100K+ token prompt. This exposes context-window handling and prompt-caching behavior differences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One tool-calling round.&lt;/strong&gt; Not all gateways forward function/tool definitions identically. This is where silent breakage lives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A 20-turn loop.&lt;/strong&gt; Agents are loops; a single-shot test that passes can still fail at turn 15 when state accumulates.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Compare latency and output diff against your golden prompt — not just error codes. If the replacement passes all three, you're safe to cut over.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: APIClaw is a flat-rate AI API gateway and is listed in the table above. The migration checklist and test procedure work with all five providers — the ranking is on what limits you, not affiliation.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post reflects what we could verify on 2026-10-26: kluster.ai's endpoint no longer resolves, and MITO AI's acquisition of kluster.ai was publicly announced. If you have a published EOL notice from kluster.ai, link it in the comments and we'll update this post.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The five-hour limit, the weekly ceiling, and what each one actually costs you</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 06:06:40 +0000</pubDate>
      <link>https://dev.to/apiclawhq/the-five-hour-limit-the-weekly-ceiling-and-what-each-one-actually-costs-you-1jm3</link>
      <guid>https://dev.to/apiclawhq/the-five-hour-limit-the-weekly-ceiling-and-what-each-one-actually-costs-you-1jm3</guid>
      <description>&lt;p&gt;Subscription AI plans advertise a message allowance. What they enforce is a set of overlapping limits that interact, and the interaction is what ends your session. This breaks down the three that matter and how to tell which one you hit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three limits, in order of how often they fire
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The rolling window.&lt;/strong&gt; A short window (commonly five hours) with a message cap that resets on a rolling basis. This is the one people notice first because it fires mid-afternoon. It is not a daily limit: the window slides, so waiting two hours can free capacity even though the day is young.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The weekly ceiling.&lt;/strong&gt; A longer allowance that the short windows draw from. This is the limit that actually ends a heavy week, and it is the one least visible in the UI. You can be inside every five-hour window and still be out of weekly capacity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The model multiplier.&lt;/strong&gt; Not all messages cost the same. Requests routed to a larger model consume the allowance faster, so the same number of prompts can be comfortable on one model and ruinous on another.&lt;/p&gt;

&lt;p&gt;The failure mode is that these compound. A user who hits the weekly ceiling on Thursday experiences it as "the five-hour limit got worse," because the short window is the only counter they can see.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to tell which one you hit
&lt;/h2&gt;

&lt;p&gt;The signal is in the reset time, not the error message:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resets in ~5 hours&lt;/strong&gt; → rolling window. Wait it out, or reduce model size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resets on a named day&lt;/strong&gt; → weekly ceiling. Waiting a few hours will not help.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resets immediately but fails again on the next long request&lt;/strong&gt; → context size, not the cap. A single large request can be refused when the window looks open.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last case is the one people misdiagnose most often. A 200k-token request against a nearly-empty window can still fail, and the error reads like a rate limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the limits are actually protecting
&lt;/h2&gt;

&lt;p&gt;These caps exist because a long agent run has a cost profile a chat message does not. An agent loop re-sends its accumulated context on every step, so one task can consume more input tokens than a hundred chat turns. Providers cap it because the tail of that distribution is expensive and hard to predict.&lt;/p&gt;

&lt;p&gt;That is a reasonable thing to cap. The problem for anyone running agents is that a message-count limit is the wrong unit: it does not tell you how many agent steps you can afford, and the answer changes with context length and model choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The practical workaround
&lt;/h2&gt;

&lt;p&gt;If your workload is agents rather than chat, the useful question is not "how many messages do I get" but "how many requests can I issue, and what happens at the limit." A request-based allowance answers that directly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can compute steps per task, and therefore tasks per day, before you start.&lt;/li&gt;
&lt;li&gt;The ceiling is a count rather than a moving token budget, so scheduling work becomes arithmetic.&lt;/li&gt;
&lt;li&gt;A clean refusal at the boundary lets your client back off instead of degrading mid-task.&lt;/li&gt;
&lt;/ul&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, priced per request rather than per token, with published request limits per plan and separate keys per client. Per-tool setup for Cursor, [CC], Codex and about twenty other clients is in the &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to check before you switch anything
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Are request limits published per plan, or only token limits?&lt;/strong&gt; A plan with no request cap has no upper bound you can plan against.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What happens exactly at the ceiling?&lt;/strong&gt; A &lt;code&gt;429&lt;/code&gt; with &lt;code&gt;Retry-After&lt;/code&gt; is workable. A dropped stream wastes the attempt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can you attribute spend per client?&lt;/strong&gt; If several clients share one key, you cannot compute cost per task for any of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Does the provider separate the rolling window from the weekly ceiling?&lt;/strong&gt; If not, you will keep misdiagnosing which one you hit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Measure your own workload before committing to any of it. The limits on the pricing page describe the plan; the limits you hit describe your job.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Cost per completed task is the only AI API number worth comparing</title>
      <dc:creator>APIClaw</dc:creator>
      <pubDate>Mon, 26 Oct 2026 05:03:51 +0000</pubDate>
      <link>https://dev.to/apiclawhq/cost-per-completed-task-is-the-only-ai-api-number-worth-comparing-2695</link>
      <guid>https://dev.to/apiclawhq/cost-per-completed-task-is-the-only-ai-api-number-worth-comparing-2695</guid>
      <description>&lt;p&gt;Every pricing page quotes a rate. Almost none quote the number you actually need: what one finished task costs. Those are different numbers, and for agent workloads they diverge by more than an order of magnitude.&lt;/p&gt;

&lt;p&gt;Here is how to measure it, and why per-token comparisons between providers mislead even when the rates are correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the quoted rate is not the cost
&lt;/h2&gt;

&lt;p&gt;A token rate tells you the price of a unit of input and output. To get from there to the cost of a task you need four more facts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How many steps the task takes.&lt;/strong&gt; An agent loop re-sends its accumulated context on every step. A twenty-step task does not consume twenty requests' worth of tokens; it consumes the sum of a growing context, which is quadratic in the number of steps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How much of the context is cacheable.&lt;/strong&gt; If the provider bills cached input at a discount, the same transcript can cost several times less. If it does not, you pay full rate for the same text on every step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How many attempts fail.&lt;/strong&gt; A task that takes three tries costs three times as much, and the retries are the longest, most context-heavy calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What a retry re-sends.&lt;/strong&gt; Some frameworks restart with a fresh context on retry; others carry the failure forward. The second is cheaper per attempt and more expensive per task, because it burns steps re-reading a transcript that already failed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that appears on a pricing page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The measurement that actually works
&lt;/h2&gt;

&lt;p&gt;You do not need a benchmark harness. You need to log four fields per task and do arithmetic.&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;tokens_in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokens_out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;repr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;task_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ok&lt;/span&gt;&lt;span class="sh"&gt;"&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;seconds&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="c1"&gt;# fill these from your client's usage callback
&lt;/span&gt;        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tokens_in&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tokens_in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tokens_out&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tokens_out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it over twenty or thirty real tasks from your actual workload, not synthetic prompts. Then:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;cost per completed task = total spend / number of tasks that finished correctly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The denominator is the part people skip. Tasks that failed still cost money, so excluding them flatters whichever provider fails more often. If provider A charges half as much per token but needs 1.4 attempts per task, A is not cheaper.&lt;/p&gt;

&lt;h2&gt;
  
  
  A worked example
&lt;/h2&gt;

&lt;p&gt;Take a refactor task that takes about eighteen agent steps, with roughly 9,000 tokens of context per step that grows to 14,000 by the end. Total input lands near 200,000 tokens per attempt. Add output.&lt;/p&gt;

&lt;p&gt;Under a metered rate of $3 per million input and $15 per million output, that attempt costs roughly $0.66 in input plus a few cents of output. Call it $0.70. At 1.3 attempts per task, the real cost is about &lt;strong&gt;$0.91 per completed task&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Under a flat allowance where you get 240,000 requests a month for $129, the same task consumes 18 requests (or 23 including retries). That is 0.0096% of the monthly allowance, or roughly &lt;strong&gt;$0.012 per completed task&lt;/strong&gt; — but only if you actually consume the allowance. If you use 10% of it, the effective cost is ten times higher.&lt;/p&gt;

&lt;p&gt;That last clause is the whole game. Flat pricing is cheap per task when utilisation is high and expensive per task when it is low. Metered pricing is the reverse. Neither is universally better, which is why the comparison has to be per-task, at your utilisation.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Does the provider publish request limits per plan, or only token limits?&lt;/strong&gt; A plan with no published request cap has no upper bound you can plan against.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is cached input billed at a discount, and does the discount survive long transcripts?&lt;/strong&gt; Cache hit rates collapse when context keeps changing, which is the normal case for agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What happens at the ceiling?&lt;/strong&gt; A clean &lt;code&gt;429&lt;/code&gt; with &lt;code&gt;Retry-After&lt;/code&gt; lets your client back off. A dropped stream mid-task wastes the whole attempt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can you see spend per key?&lt;/strong&gt; If several clients share one key you cannot attribute cost, so you cannot compute per-task cost for any of them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I run this on a flat allowance
&lt;/h2&gt;

&lt;p&gt;For my own workload the deciding factor was not the rate, it was the variance. A metered bill for agent work is knowable only after the month ends, which makes it hard to price work for a client. A request allowance converts the variable into a count I choose before starting.&lt;/p&gt;

&lt;p&gt;The gateway 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, with per-client keys so attribution is not a spreadsheet exercise. The per-tool setup notes for Cursor, [CC], Codex and about twenty other clients are in the &lt;a href="https://apiclaw.biz/docs/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Whatever you pick, measure cost per completed task on your own workload before you commit. The rate on the pricing page is the least informative number on it.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <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>
