OpenAI API spend limits: what they actually stop (and what they don't)

·3h ago
Share:PostShare

I went through every setting OpenAI gives you to stop a surprise API bill. Here's where each one lives and how much it really protects you. 1. Turn off auto-reload If you're on prepaid credits, there's a setting that tops you up when the balance gets low. Mine was on and I didn't remember turning it on. Settings → Billing → Overview → "Auto-reload credits" "Manage auto-reload" to switch it off With it off, you can't spend more than you prepaid. The catch is your app stops when credits run out, so it depends on what you'd rather have happen. 2. Set a hard monthly limit You can set a monthly limit for the whole organization and for each project. Organization: Settings → Organization → Limits → Spend → "Edit spend limit" Project: the project's settings → Limits, same thing Make sure "Enforce a hard limit" is on. Without it you only get a spend alert. With it, requests over the limit get a 429. Two things to know: It's not instant. The docs say recorded spend can go slightly over the amount you set. It's monthly. There's no daily limit, so one bad night can still use the whole month. 3. One project per agent Projects get their own keys and limits. Giving each agent or app its own project means you can see which one spent what, and cap them separately. A lot better than one key shared by everything. What's still missing The official settings cover most of it. What's left: a daily stop, so an overnight loop can't reach the monthly cap the lag, which lets spend go a little over For those I hand agents a proxy key with a daily cap instead of the real key. The proxy reserves the worst-case cost before each call, so nothing gets through past the cap. It's Saifuban, I built it, it's open source. If you do nothing else today: turn off auto-reload and set a hard monthly limit.

D

Dev Community

Original source

Read full story

Related Stories

A decades-old math problem solved with AI

In September, OpenAI announced that autonomous artificial intelligence agents had broken the stalemate on a mathematical model governing how fluids behave. School of Arts & Sciences math professor Philip Gressman brought together students and faculty to verify the claim.

UUniversity Of Pennsylvania

Headlines and briefs on this site are for information only. Always verify details on the original source or live status page.

Read Disclaimer