<?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: KeyBark</title>
    <description>The latest articles on DEV Community by KeyBark (@keybark).</description>
    <link>https://dev.to/keybark</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%2F4217002%2F19a5383c-41dd-4933-8d15-906089e073f3.png</url>
      <title>DEV Community: KeyBark</title>
      <link>https://dev.to/keybark</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/keybark"/>
    <language>en</language>
    <item>
      <title>Your AI API spend limit might not stop anything: a 10-minute check for OpenAI, Anthropic and OpenRouter</title>
      <dc:creator>KeyBark</dc:creator>
      <pubDate>Fri, 30 Oct 2026 10:32:16 +0000</pubDate>
      <link>https://dev.to/keybark/your-ai-api-spend-limit-might-not-stop-anything-a-10-minute-check-for-openai-anthropic-and-744</link>
      <guid>https://dev.to/keybark/your-ai-api-spend-limit-might-not-stop-anything-a-10-minute-check-for-openai-anthropic-and-744</guid>
      <description>&lt;p&gt;A leaked or looping API key keeps billing until something actually blocks it. This month's OpenCode Console breach showed how many of us assumed a provider "limit" would do that, and found out it didn't. Here's a quick check, straight from the providers' own docs.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenAI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A limit only blocks traffic if "Enforce a hard limit" is on.&lt;/strong&gt; Spend alerts only notify. With enforcement on, requests get a &lt;code&gt;429&lt;/code&gt; with &lt;code&gt;organization_spend_limit_exceeded&lt;/code&gt; or &lt;code&gt;project_spend_limit_exceeded&lt;/code&gt;. Enforcement isn't immediate, so spend can go slightly past the cap. (&lt;a href="https://developers.openai.com/api/docs/guides/spend-limits" rel="noopener noreferrer"&gt;OpenAI spend limits&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give each project that runs agents its own hard limit&lt;/strong&gt;, so one runaway project can't eat the whole org budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use project-scoped keys with an expiry date&lt;/strong&gt;, and rotate them. OpenAI also says never to ship a key to a browser or mobile app. (&lt;a href="https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety" rel="noopener noreferrer"&gt;OpenAI key safety&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Anthropic
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You can't set a spend limit on the Default Workspace.&lt;/strong&gt; Only the organization limit applies there. Create a separate workspace, give it a monthly limit, and move production keys into it. (&lt;a href="https://platform.claude.com/docs/en/manage-claude/workspaces" rel="noopener noreferrer"&gt;Anthropic workspaces&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expect usage data to lag a little&lt;/strong&gt;, so don't rely on a check that runs once a day.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  OpenRouter
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Set a per-key credit limit&lt;/strong&gt; with a reset (&lt;code&gt;daily&lt;/code&gt;, &lt;code&gt;weekly&lt;/code&gt; or &lt;code&gt;monthly&lt;/code&gt;). &lt;code&gt;GET https://openrouter.ai/api/v1/key&lt;/code&gt; shows &lt;code&gt;limit_remaining&lt;/code&gt;. (&lt;a href="https://openrouter.ai/docs/api/api-reference/api-keys/create-a-new-api-key" rel="noopener noreferrer"&gt;OpenRouter keys&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Every provider
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep keys out of frontend code and public repos, including git history.&lt;/li&gt;
&lt;li&gt;Give agents a max-steps, max-tokens or timeout guard. Retries in a loop are the most common surprise bill.&lt;/li&gt;
&lt;li&gt;Have something other than your laptop watching spend overnight.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A shortcut
&lt;/h2&gt;

&lt;p&gt;Disclosure: I built KeyBark. Its free &lt;a href="https://keybark.com/limit-audit?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=w1&amp;amp;utm_content=spend-limit-check" rel="noopener noreferrer"&gt;limit audit&lt;/a&gt; walks through the checks above as yes/no questions (runs in your browser, no sign-up, no key) and lists what to fix. KeyBark itself is a hosted watcher that emails you when spend crosses a threshold (free for one key), but you don't need it to do anything in this post.&lt;/p&gt;

</description>
      <category>openai</category>
      <category>ai</category>
      <category>security</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
