SShortSingh.
Back to feed

Developer Builds Rate-Limiting System After One User Drained Telegram Bot's Daily AI Quota

0
·19 views

A developer running a Telegram bot powered by Google's Gemini free-tier API faced a critical outage after a single user sent 1,400 messages in three hours, exhausting the 1,500 daily request limit and leaving over 999 other users unable to access AI features. To prevent recurrence, the developer implemented a three-layer protection system consisting of per-user rate limiting, a global daily request cap, and an in-memory response cache for frequently asked questions. The caching layer alone reduced quota consumption by an estimated 50–70%, with no additional infrastructure or database costs. Following these changes, 99% of users were reported as unaffected during subsequent bot usage. The experience highlighted a broader vulnerability in free-tier AI APIs, where no built-in safeguards exist against individual users monopolising shared daily quotas.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

Shortage of Male Protagonists May Be Deterring Young Boys From Reading

An Atlantic article examines whether the scarcity of male lead characters in middle-grade books is discouraging boys from reading. The piece frames the issue as a possible barrier to getting young male readers engaged with books. It draws on the premise that children often prefer stories featuring characters they can identify with. The original source is a Hacker News post linking to the article, which has drawn only limited discussion so far. The details of the author's specific evidence are not included in the available source text.

0
ProgrammingDEV Community ·

Saifuban adds daily API budgets to cap runaway AI agent spending

A developer built a daily API spending cap into Saifuban, a guard tool for AI agents, after worrying about agents stuck in loops running up large bills overnight. Users store their provider API key in Saifuban and receive a proxy key, which the agent uses so that all requests route through the service. Saifuban tallies each request's cost from the usage data in responses and, once a per-agent daily budget is reached, returns a 403 error instead of forwarding further calls until the next day. The cap supports OpenAI, Anthropic, Google Gemini, and OpenRouter, with costs calculated from token counts and price tables for all but OpenRouter, which reports actual cost. Requests already in flight when the limit is hit may push spending slightly over budget, and users must trust the tool with their real API keys, which are stored encrypted.

0
ProgrammingDEV Community ·

Indie Builder Automates Nine-Product Gumroad Launch With 20 Node Scripts, Reports Zero Sales

An indie developer launched nine digital products on Gumroad and used roughly 20 single-purpose Node scripts to automate posting, logins, verification-code retrieval, and analytics checks. The setup relies on Chrome DevTools Protocol via playwright-core with a persistent browser profile, with each task spawning and closing its own browser instance to avoid crashes. After eight days, the store had 74 views, no sales, and one follower. The author documented techniques such as extracting login codes from webmail and working around a community platform that dropped email signup in favor of Google OAuth. The post is shared as a technical account of what was automated and what failed, and it includes links to the author's own store.

0
ProgrammingDEV Community ·

Developer Uses Parallel Claude Code Agents to Generate Hundreds of Chinese Career Stories

A developer built a free browser game, One Job, One Life, in which players draw a random Chinese job card and live it year by year until retirement. The game's stories and rules were written ahead of time with Claude Code, so gameplay itself requires no per-play AI cost. Place and employer shape each career's pay curve and advancement ceiling, and AI gradually takes over specific tasks rather than whole jobs. The author used multiple agents working in parallel, each producing and validating career drafts against an occupation dataset. The write-up also describes problems that came up when one agent's error affected the shared build script.