Repository navigation
Description
GET /v1/personas/twitter/initial-message runs tracked LLM spend with no quota gate and no rate limiter — the only billable route in backend/routers/apps.py with neither.
Current state on main
@router.get('/v1/personas/twitter/initial-message', tags=['v1'], response_model=TwitterInitialMessageResponse)
def get_twitter_initial_message(username: str, uid: str = Depends(auth.get_current_user_uid)):
...
with track_usage(uid, Features.PERSONA):track_usage attributes spend; it does not block. So a free user past the monthly cap can call this indefinitely.
Every billable route in that router, for comparison
| route | feature | quota gate | rate limit |
|---|---|---|---|
POST /v1/app/generate-description |
APP_GENERATOR |
yes | no |
POST /v1/app/generate-description-emoji |
APP_GENERATOR |
yes | no |
POST /v1/app/generate |
APP_GENERATOR |
yes | no |
POST /v1/app/generate-icon |
APP_GENERATOR |
yes | no |
GET /v1/app/generate-prompts |
APP_GENERATOR |
#12749 | yes |
GET /v1/personas/twitter/initial-message |
PERSONA |
no | no |
The APP_GENERATOR family was closed by #12739 and #12749. This one was never in either sweep's scope, and it is the least protected of the six: generate-prompts at least sat behind auth.with_rate_limit(...), which bounded call frequency even while the quota was missing. This route has neither bound.
Why it is not simply "add the same gate"
enforce_chat_quota bounds spend against the chat quota, and the four gated routes above already share that pattern. Whether PERSONA spend should count against the same monthly counter is a billing-policy question rather than a wiring one — the same open question Git-on-my-level raised on #12749 about whether APP_GENERATOR spend should increment quota_questions at all. Today none of these routes accrue to the counter they are gated on, so a user who only ever calls generators never crosses the cap that stops them.
So there are two separable things here:
- Wiring — give this route some bound. The cheapest correct step is the rate limiter its siblings have, which needs no policy decision.
- Policy — decide whether generator/persona spend increments the chat quota counter. That one deserves an owner, since it changes what "free tier" means rather than how it is enforced.
Happy to send (1) as a small PR matching the router's existing shape. (2) I would rather not decide unilaterally.
Found while correcting an inaccurate claim in #12749's description, which called generate-prompts the last ungated managed-spend route in the router. It was the last ungated APP_GENERATOR route; this one is still open.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn review
Activity
fix(backend): rate-limit GET /v1/personas/twitter/initial-message (#1…
aryanorastar commentedon Sep 10, 2026
Closing this issue as fixed by #12784, which adds the existing 30/hour rate limiter to GET /v1/personas/twitter/initial-message and adds regression coverage.
Whether PERSONA spend should count against the monthly quota remains a separate billing-policy question and should be handled in a follow-up issue if maintainers decide it needs action.