The question box and its cost guardrails

提问框及其成本护栏

The Ask the site box is the only model call a visitor can trigger without logging in. What one answer costs, the gates in front of it cheapest first, where the four limits live, and the vendor-console cap that holds when counters fail.

Cost limits

Every model call in AIBlog sits behind the editor login except one.

The Ask the site box on the search page answers visitors' questions from published content, and anyone can use it. It is therefore treated as a cost surface and fenced on several sides, cheapest gate first.

What one answer costs

An answer is one bounded call: a fixed-size prompt of at most six excerpts, six hundred output tokens at most, on the smallest model. That is about half a US cent. Because the call is bounded, bounding the number of calls bounds the spend whatever the questions contain.

The gates

  • the request body is capped at eight kilobytes on public routes, counted as it arrives, so nobody can post megabytes into the box
  • a question is at most four hundred characters and must contain at least two letters
  • identical questions within ten minutes are answered from a cache
  • a per-minute token bucket per client address stops bursts
  • a per-address daily count, kept in the store against a hashed address, stops one client draining the day
  • no model call is made unless retrieval returns excerpts above a relevance threshold, so an off-topic question costs nothing
  • a site-wide daily count and a site-wide daily dollar budget, kept in the store and estimated from token usage, bound the total bill whoever is asking
  • an answer that does not cite the excerpts is discarded and replaced by a fixed "not covered" line, so padding a question with a phrase from the site to get past retrieval gains nothing

Where the limits live

The limits are four numbers in the site configuration: questions per minute, per address per day, per day, and dollars per day.

LimitThis site
questions per minuteten
per address per dayforty
per daythree hundred
dollars per daytwo dollars

When a daily gate trips the route answers with a plain sentence in the visitor's language and the keyword search keeps working.

What the owner sees

The admin usage page shows today's question count and estimated spend against the limits, alongside the estimated dollar cost of every model call the site has made.

The backstop

Counters in the site can fail. The limit that holds regardless is a monthly spend cap set in the model vendors' own consoles. That is an owner action per client, not code, and the hand-off manual asks for it.

What is deliberately absent

There is no CAPTCHA. It would cost every honest visitor a step to stop an abuse that has not been observed, and the daily caps already bound the damage. If abuse appears, a challenge can be added in front of the same route.