Skip to content

LLM API Cost

What It Depends On

The paid LLM-API is priced by tokens: the longer the prompt and response, the more expensive the request. Uncontrolled integration into a public service is a direct path to budget depletion.

How to Control

In protecting the paid API there are four layers:

  1. Cache by URL — a repeated request costs 0 tokens;
  2. Quota (for example, 3 requests/day) — a limit per user;
  3. Token limit (max_tokens) — a ceiling for one response;
  4. Server-side key — the front-end cannot steal it and make a direct call.

See Also

← All Terms