AI costs & security · 2026

Your /generate endpoint has no rate limit.
One for-loop turns your OpenAI bill into the punchline.

A normal endpoint that gets abused wastes CPU. An AI endpoint that gets abused wastes money, in real time, on your card. Here is how to cap it before the bill lands.

See the spike before the invoice.

Belmo watches your logs for runs of rate-limit rejections and bursts on a single route, and alerts you on Telegram while the number is still small.

No credit card required 1 service free forever AI log monitoring Telegram alerts in plain English
Frequently asked

Quick answers

Why is rate limiting an AI endpoint different from a normal API?

A normal endpoint under abuse burns CPU and gets slow, which caps the damage. An AI endpoint spends money on every call while your server barely works, so nothing looks wrong until the invoice. The goal is a hard cap on spend, not just smoother traffic.

What rate limit should I start with?

Ten requests per minute per IP on every route that calls a model is a good floor. It is plenty for a person clicking a button and a wall for a script. Add per-user daily quotas once you have accounts.

Why does my rate limiter block all my users at once?

Behind a proxy or CDN, your app may see the proxy's IP for every request, so everyone shares one limit. In Express, set app.set("trust proxy", 1) with the right hop count so the limiter reads the forwarded client IP.

What is a global spend cap?

One shared counter across all users and routes that allows at most a fixed number of expensive calls per hour, then refuses and alerts you. Set it well above a good real day. It is the circuit breaker for the abuse you did not predict.

How should my front end handle a 429 response?

Catch it and show a human message such as "you are going a bit fast, try again in a moment", using the Retry-After header for the delay. An unhandled 429 often shows up as a spinner that never ends and a "the app is broken" report.