Skip to main content
Security guideReviewed

LLM cost abuse: how someone else runs up your AI bill, and the limits that stop it

An AI feature billed per token turns every extra request, longer prompt and longer answer into cost.

This guide shows how one request multiplies into a large bill, why the limits on your provider account count all your users together, and where per-user quotas, tenant budgets, concurrency limits, alerts and a kill switch have to sit. The token-budget model at the end copies straight into a spreadsheet.

Token-budget model: limits in place against limits missing

An illustration with invented figures for a fictional help assistant inside a business software product, where each customer business is a tenant. It is not a client system.

How to use it

Copy the table into a spreadsheet with the headings in row 1, so each line lands on the row number it starts with. Rows 2 to 14 are inputs: replace the figures with your own. Rows 15 to 21 are calculated, and the formula column gives each calculation for column C, so paste it into column C and fill it across to column D. Rows 22 and 23 compare the two columns, so their formulas go in column D. Column D leaves out your provider's rate limits, which count every user of the account together. Each tool round also adds its result to the next call's input, so row 17 understates requests that use tools heavily.

22 rows

Token-budget model: limits in place against limits missing

Row and lineWhat it measuresC: limits in placeD: limits missingFormulaWhat holds it, on the server before the model call
2. Requests per user per dayHow many questions one signed-in user can ask in a day.401,000Input: your figurePer-user quota, counted against the user in the verified session (scenario 1).
3. Requests in flight at once per userHow many of one user's requests can run in parallel.250Input: your figureConcurrency limit, taken before the call and released when it ends or fails (scenario 3).
4. Seconds per requestAverage time from a request arriving to its last token, used only to estimate pace.88Input: your figureNot a limit. A server timeout ends the slowest requests.
5. Fixed prompt tokensInstructions and tool definitions sent with every model call.1,5001,500Input: your figureKept short by design and reviewed whenever a tool is added.
6. History tokens per callEarlier turns of the conversation resent with each call.2,00030,000Input: your figureHistory trimmed or summarised on the server to a set number of turns.
7. User message tokensThe new message, including any pasted text or file contents.50012,000Input: your figureInput size cap, measured on the server where the call is assembled.
8. Retrieved passages per callPassages the search step adds to the input.420Input: your figureA fixed passage count on the server that no request parameter can raise.
9. Tokens per passageThe size of each retrieved passage.400400Input: your figurePassage size, set when documents are indexed.
10. Output tokens per callThe answer, plus any reasoning tokens billed as output.6004,000Input: your figureOutput cap sent with every call, sized to the longest answer the feature needs.
11. Model calls per requestOne call to answer plus one for each tool round the model asks for.310Input: your figureRound cap in the server's tool loop, counted for each request.
12. Attempts per model callAverage attempts including retries; 1.1 means one call in ten is retried once.1.12Input: your figureOne layer owns retries, with a cap on attempts and on total retry time.
13. Tenant daily token budgetThe allowance you set for one customer business each day.20,000,00020,000,000Input: your figureTenant budget, counted against the tenant in the verified session (scenario 2).
14. Alert thresholdShare of the tenant budget that raises an alert.50%50%Input: your figureAnomaly alert on your own token counts, sent to a named person (scenario 4).
15. Input tokens per model callEverything sent with one call.5,60051,500=C5+C6+C7+C8*C9Held by rows 6, 7 and 8.
16. Tokens per model callInput plus output for one call.6,20055,500=C15+C10Held by rows 6, 7, 8 and 10.
17. Tokens per user requestOne question's full cost: tokens per call times calls times attempts.20,4601,110,000=C16*C11*C12Held by rows 11 and 12 on top of the call caps.
18. Tokens per user per dayOne user's day at the request rate in row 2.818,4001,110,000,000=C17*C2Held by the per-user quota counted in tokens, which also catches expensive requests a request count lets through.
19. One user's day as a share of the tenant budgetHow much of the whole customer's allowance one user can spend.4.1%5,550%=C18/C13, formatted as a percentageHeld by the tenant budget. In column D one user spends 55.5 days of the tenant's allowance.
20. Tokens per minute one user can drawPace with every allowed request in flight at once.306,900416,250,000=C17*C3*60/C4Held by the concurrency limit in row 3.
21. Minutes for one user to reach the alert thresholdHow much warning an alert gives before one user crosses it.32.6, but the quota in row 2 stops this user at 4.1% of the budget first0.024, about 1.4 seconds=C13*C14/C20In column D the alert arrives after the spend, so the quota and concurrency limit have to hold on their own.
22. One request, column D as a multiple of column CHow far the missing caps multiply a single request.154.3=D17/C17, entered in column DRows 6, 7, 8, 10, 11 and 12 together.
23. One user's day, column D as a multiple of column CHow far every missing limit multiplies one user's day.11,356=D18/C18, entered in column DEvery limit missing at once. The kill switch and the provider's hard limit are what remain.

Row and line

What it measures

  1. 2. Requests per user per day
    What it measures
    How many questions one signed-in user can ask in a day.
    C: limits in place
    40
    D: limits missing
    1,000
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Per-user quota, counted against the user in the verified session (scenario 1).
  2. 3. Requests in flight at once per user
    What it measures
    How many of one user's requests can run in parallel.
    C: limits in place
    2
    D: limits missing
    50
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Concurrency limit, taken before the call and released when it ends or fails (scenario 3).
  3. 4. Seconds per request
    What it measures
    Average time from a request arriving to its last token, used only to estimate pace.
    C: limits in place
    8
    D: limits missing
    8
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Not a limit. A server timeout ends the slowest requests.
  4. 5. Fixed prompt tokens
    What it measures
    Instructions and tool definitions sent with every model call.
    C: limits in place
    1,500
    D: limits missing
    1,500
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Kept short by design and reviewed whenever a tool is added.
  5. 6. History tokens per call
    What it measures
    Earlier turns of the conversation resent with each call.
    C: limits in place
    2,000
    D: limits missing
    30,000
    Formula
    Input: your figure
    What holds it, on the server before the model call
    History trimmed or summarised on the server to a set number of turns.
  6. 7. User message tokens
    What it measures
    The new message, including any pasted text or file contents.
    C: limits in place
    500
    D: limits missing
    12,000
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Input size cap, measured on the server where the call is assembled.
  7. 8. Retrieved passages per call
    What it measures
    Passages the search step adds to the input.
    C: limits in place
    4
    D: limits missing
    20
    Formula
    Input: your figure
    What holds it, on the server before the model call
    A fixed passage count on the server that no request parameter can raise.
  8. 9. Tokens per passage
    What it measures
    The size of each retrieved passage.
    C: limits in place
    400
    D: limits missing
    400
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Passage size, set when documents are indexed.
  9. 10. Output tokens per call
    What it measures
    The answer, plus any reasoning tokens billed as output.
    C: limits in place
    600
    D: limits missing
    4,000
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Output cap sent with every call, sized to the longest answer the feature needs.
  10. 11. Model calls per request
    What it measures
    One call to answer plus one for each tool round the model asks for.
    C: limits in place
    3
    D: limits missing
    10
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Round cap in the server's tool loop, counted for each request.
  11. 12. Attempts per model call
    What it measures
    Average attempts including retries; 1.1 means one call in ten is retried once.
    C: limits in place
    1.1
    D: limits missing
    2
    Formula
    Input: your figure
    What holds it, on the server before the model call
    One layer owns retries, with a cap on attempts and on total retry time.
  12. 13. Tenant daily token budget
    What it measures
    The allowance you set for one customer business each day.
    C: limits in place
    20,000,000
    D: limits missing
    20,000,000
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Tenant budget, counted against the tenant in the verified session (scenario 2).
  13. 14. Alert threshold
    What it measures
    Share of the tenant budget that raises an alert.
    C: limits in place
    50%
    D: limits missing
    50%
    Formula
    Input: your figure
    What holds it, on the server before the model call
    Anomaly alert on your own token counts, sent to a named person (scenario 4).
  14. 15. Input tokens per model call
    What it measures
    Everything sent with one call.
    C: limits in place
    5,600
    D: limits missing
    51,500
    Formula
    =C5+C6+C7+C8*C9
    What holds it, on the server before the model call
    Held by rows 6, 7 and 8.
  15. 16. Tokens per model call
    What it measures
    Input plus output for one call.
    C: limits in place
    6,200
    D: limits missing
    55,500
    Formula
    =C15+C10
    What holds it, on the server before the model call
    Held by rows 6, 7, 8 and 10.
  16. 17. Tokens per user request
    What it measures
    One question's full cost: tokens per call times calls times attempts.
    C: limits in place
    20,460
    D: limits missing
    1,110,000
    Formula
    =C16*C11*C12
    What holds it, on the server before the model call
    Held by rows 11 and 12 on top of the call caps.
  17. 18. Tokens per user per day
    What it measures
    One user's day at the request rate in row 2.
    C: limits in place
    818,400
    D: limits missing
    1,110,000,000
    Formula
    =C17*C2
    What holds it, on the server before the model call
    Held by the per-user quota counted in tokens, which also catches expensive requests a request count lets through.
  18. 19. One user's day as a share of the tenant budget
    What it measures
    How much of the whole customer's allowance one user can spend.
    C: limits in place
    4.1%
    D: limits missing
    5,550%
    Formula
    =C18/C13, formatted as a percentage
    What holds it, on the server before the model call
    Held by the tenant budget. In column D one user spends 55.5 days of the tenant's allowance.
  19. 20. Tokens per minute one user can draw
    What it measures
    Pace with every allowed request in flight at once.
    C: limits in place
    306,900
    D: limits missing
    416,250,000
    Formula
    =C17*C3*60/C4
    What holds it, on the server before the model call
    Held by the concurrency limit in row 3.
  20. 21. Minutes for one user to reach the alert threshold
    What it measures
    How much warning an alert gives before one user crosses it.
    C: limits in place
    32.6, but the quota in row 2 stops this user at 4.1% of the budget first
    D: limits missing
    0.024, about 1.4 seconds
    Formula
    =C13*C14/C20
    What holds it, on the server before the model call
    In column D the alert arrives after the spend, so the quota and concurrency limit have to hold on their own.
  21. 22. One request, column D as a multiple of column C
    What it measures
    How far the missing caps multiply a single request.
    C: limits in place
    1
    D: limits missing
    54.3
    Formula
    =D17/C17, entered in column D
    What holds it, on the server before the model call
    Rows 6, 7, 8, 10, 11 and 12 together.
  22. 23. One user's day, column D as a multiple of column C
    What it measures
    How far every missing limit multiplies one user's day.
    C: limits in place
    1
    D: limits missing
    1,356
    Formula
    =D18/C18, entered in column D
    What holds it, on the server before the model call
    Every limit missing at once. The kill switch and the provider's hard limit are what remain.

What LLM cost abuse is, and who ends up paying

LLM cost abuse is consumption of your AI feature that you pay for and did not intend: someone else's requests, scripts or loops turning your model account into the engine for their workload.

For a model billed per token, anything that lets a person send more requests or longer inputs, or ask for longer outputs, than the feature needs moves cost from them to you. No data has to leak and nothing has to break for the abuse to work. The invoice is the damage, whether the subject is called AI token cost abuse, LLM denial of wallet or simply an unexpected bill.

OWASP covers this in LLM10:2025 Unbounded Consumption, which occurs when an LLM application allows users to conduct excessive and uncontrolled inferences, leading to risks such as denial of service, economic losses, model theft and service degradation. Its common examples include Denial of Wallet (DoW): initiating a high volume of operations to exploit the cost-per-use model of cloud-based AI services, leading to unsustainable financial burdens on the provider. For a business running an AI feature, that burden is its own model bill.

LLM token exhaustion is a related term with two meanings worth keeping apart. One is your allowance: a quota, spend limit or rate limit on the account runs out, and the feature stops for every user, not only the one who used it up.

The other is the context window. OWASP lists Continuous Input Overflow, continuously sending inputs that exceed the LLM's context window, which can lead to excessive computational resource use, resulting in service degradation and operational disruptions.

The routes do not need a skilled attacker

AI API cost abuse can come from a stranger, a customer or your own code. Each route below reaches the same bill, and each is closed by a different limit.

  • A public chat box with no sign-in, which anyone can script.
  • A free trial that one person can sign up for many times.
  • A paying customer's user who automates a feature the customer pays for per seat.
  • A provider key shipped in browser or mobile app code, which anyone can copy and call directly, outside every limit your application applies.
  • A retry loop or a tool loop in your own code that keeps calling the model with nobody behind it.

Six multipliers behind the token count of one request

One question from a user is not one model call.

Its cost is the tokens in each call, times the calls the request makes, times the attempts per call. A user's day is that figure times the requests they can send. The token-budget model on this page sets each multiplier out as a spreadsheet row, with a column of figures where limits are in place and a column where they are missing.

Every limit below runs on your server and applies before the model is called, because a limit applied afterwards has already paid for the tokens.

Request rate, and requests in flight at once

Rate is the outer multiplier. 1 min read

Context size: what is resent with every call

Each call carries the fixed instructions and tool definitions, the conversation so far, any retrieved passages and the new message. 1 min read

Output caps: how much the model may write

An output cap is a number your server sends with every call. 1 min read

Retrieval volume: how much your own documents add

A search step adds passages to the input of every call: the number of passages times their size. 1 min read

Retries: attempts you pay for without seeing them

Retries multiply calls quietly. 1 min read

Tool loops: rounds of calls inside one request

A request that can use tools is a loop. 1 min read

Provider limits cap the account, not each of your users

Model providers offer limits of their own, and they belong in the design as the backstop.

They work at a different level from the controls on this page. OpenAI's rate-limit guide says its rate limits are defined at the organisation level and at the project level, not user level. Anthropic's says its limits are set at the organisation level, and that you can set custom spend and rate limits for each workspace, though not a spend limit on the default workspace.

Those levels are divisions of your account, not your users. A limit at that level counts every user of the feature together, so when one user exhausts it, the feature stops for all of them.

The next question is whether a limit stops traffic or only tells you about it. OpenAI's guide describes two spend controls for an organisation or project: a spend alert sends a notification and API traffic continues, while a hard spend limit, which enforces a monthly organisation or project cap, makes affected API requests return a 429 error.

In Anthropic's documentation, when usage reaches a spend limit you have set below your tier's cap, requests return an HTTP 400 error whose message states when access resumes. Google Cloud's billing documentation says an alerts-only budget doesn't automatically cap usage or spending, and that there is a delay between your use of resources and the usage costs reporting to Cloud Billing.

It describes programmatic notifications that can automate tasks such as disabling billing on a project when it exceeds its budget amount.

Put together, the design follows. Set a hard limit at the provider where it offers one, sized to what the business can absorb, and treat reaching it as an outage you chose in place of a larger bill. Where billing data lags behind usage, as Google describes for Cloud Billing, an alert built on that data reports spend after it has happened, which suits watching trends rather than stopping abuse.

Deciding who may use the allowance, one user or one customer at a time, stays with your application, counted in tokens as each request arrives.

OpenAI's safety best practices add two habits. Users should generally need to register and log in to access the service, and a safety identifier, a string that uniquely identifies each user, such as a hashed username or email, sent with each request, can help OpenAI monitor and detect abuse and help your team respond to it faster.

The same page says to revoke an API key promptly and replace it if you believe it has been exposed, misused or otherwise compromised. Keep provider keys on your server, so the only route to the model runs through your limits.

Five controls, and where each one has to run

Each control below runs in the code path between the incoming request and the model call, keyed to the user and tenant in the verified session rather than anything the browser sends.

OWASP ASVS 5.0 requirement 2.4.1 (Level 2) describes the aim: anti-automation controls against excessive calls to application functions that could lead to outcomes including quota exhaustion, rate-limit breaches, denial of service and overuse of costly resources.

Per-user quota

A count of tokens, as well as requests, for each user in each period, checked before every call. 1 min read

Tenant budget

In a product sold to businesses, each customer business, a tenant, has a token budget of its own, counted the same way. 1 min read

Concurrency limit

A cap on requests in flight at once for each user and each tenant, taken before the model call and released when the call ends, including when it fails or times out. 1 min read

Anomaly alert

An alert on your own token counts as requests are made, not on the invoice. 1 min read

A kill switch that has been tested

A setting the business owner or an on-call person can change without a deploy, read on the server before every model call, that turns the AI feature off for one tenant or for everyone and shows users a plain message in its place. 1 min read

Synthetic abuse scenarios: one small check for each control

These scenarios check that each limit exists and holds.

They are for a business testing its own application in a test environment, with a low spending limit set on the provider project or workspace before the first request. Each uses a handful of requests: the limits are lowered for test accounts so that a few calls reach them.

None sends a flood of traffic. Load, volumetric and denial-of-service testing is separate work for a load-testing specialist, with your host's written approval. Do not run these checks against an application or account that is not yours.

  • A test environment with its own provider project or workspace and its own key, separate from production.
  • A low hard spending limit on that project or workspace, where your provider offers one, set before any test traffic.
  • Two invented test tenants, A and B, with two test users each: A1, A2, B1 and B2.
  • Test values for every limit, set low: a quota of five requests, a tenant budget a few requests deep, a concurrency limit of one.
  • Read access to the application's usage log and the provider's usage figures for the test project.

Scenario 1: the per-user quota

Set A1's quota to five requests. As A1, send one message well over the input size cap, then six ordinary questions one at a time. Then send one question as A2.

A pass: the oversized message refused before any model call with the size cap named, five answers, the sixth question refused with a message naming the quota, and A2 answered because the quota belongs to the user, not the tenant. Keep the log lines for all eight requests and A1's counter beside the provider's usage for those calls.

Scenario 2: the tenant budget

Set tenant A's budget to about three requests' worth of tokens at the caps. Send questions as A1 and A2 in turn until one is refused, then send one as B1. Repeat A1's last request with tenant B's identifier added to the request body or a header.

A pass: tenant A refused at its budget, B1 answered, the rest of the product still working for tenant A, and the altered request still charged to tenant A and refused. Keep the log lines showing which tenant each request was counted against.

Scenario 3: the concurrency limit

Set A1's concurrency limit to one. Send three questions that ask for long answers at the same moment. Then point the test environment at a stub that fails the model call, send one request, and send another once it has failed.

A pass: one request runs while the others are refused or queued with the reason logged, and the in-flight count returns to zero after each run, including the failed call, so the final request goes through. If two requests reach the model at once, the limit is being checked and taken in separate steps, and parallel requests slip through between them.

Scenario 4: the anomaly alert

Set tenant A's alert threshold to half its test budget and route alerts to a channel the test owner watches. Send questions as A1 until the threshold is crossed. Afterwards, total the tokens in your log for the test window and compare them with the provider's figures for the test project.

A pass: one alert, not one per request, received by the named person, naming the tenant, the user, the feature and the figures that crossed the threshold, and the two totals in agreement. Keep the alert, its timestamp and both totals.

Scenario 5: the kill switch

Ask a long question as A1 and, while it runs, switch the feature off for tenant A. Send one more question as A1 and one as B1. Then switch it off for everyone, send one as B1, and switch it back on.

A pass: no model call for tenant A after the switch, with a note of whether the request in flight finished or was cut off, A1 shown the plain message, B1 answered until the global switch and refused after it, and service back once the switch is reversed.

Check the production project's hard limit and key revocation in the provider's console and record who can use them. Do not try to reach that limit with traffic.

The usage log that shows the limits work

Every scenario above ends in the log, so it has to hold enough to rebuild what each request cost and why it was allowed.

ASVS 5.0 requirement 16.2.1 (Level 2) asks that each log entry includes the metadata, such as when, where, who and what, needed for a detailed investigation of the timeline when an event happens. For a model call, that means:

  • A request identifier, the user and tenant taken from the session, the feature and the time.
  • The model, and the input and output tokens as the provider's response reports them, with reasoning tokens where they are reported separately.
  • The amount reserved before the call and the amount settled after it.
  • The round number within the request and the attempt number for any retry.
  • The decision, allowed, queued or refused, and the limit that made it.
  • For alerts and the kill switch: who was told or who switched, and when.

Reconcile the log against the provider

Total the log's tokens for a period and compare them with your provider's usage figures for the same project or workspace and period. Allow for any delay in the provider's figures; once they are complete, the two should agree. Usage the provider records that your log does not means something calls the model outside your limits: a background job, a second key, an old deployment still running or a key that has leaked. The comparison is a low-cost way to find a path the five controls do not cover.

How the AI chatbot and agent security test treats cost abuse

The Clever Ops AI chatbot and agent security test includes cost controls: size caps, request limits, limits on paid tools and spending alerts with each provider.

It assesses cost abuse by finding missing limits, not by generating a large bill, and it includes no load, denial-of-service or volumetric testing. If your question is how the feature behaves under heavy traffic, that needs a load-testing specialist and your host's written approval.

The test needs a spending limit or alert on the model provider and any paid tool for the test environment, and a contact who can pause the bot if something looks wrong. If Clever Ops built or hosts your chatbot or agent, the work is a security review rather than an independent test, and the report says who built it and who hosts it.

Before the scoping call, fill in the token-budget model with your own figures. The rows where column D pulls furthest away from column C show which limit to look at first.

Frequently asked questions

It is the name OWASP uses, under LLM10:2025 Unbounded Consumption, for initiating a high volume of operations to exploit the cost-per-use model of cloud-based AI services, leading to unsustainable financial burdens on the provider. For a business running an AI feature, that is its own model bill. Nothing has to be stolen or broken for it to succeed, which is why it needs limits of its own rather than relying on the controls that guard data.

Set one, and make it a hard limit rather than an alert where your provider offers both. It is the backstop. But it counts your whole project or workspace together, so when one user exhausts it, the feature stops for every user. Per-user quotas, tenant budgets and concurrency limits in your own application decide who may use the allowance; the provider limit decides how much is lost if those fail.

Require sign-in for anything expensive where the feature allows it. Give anonymous visitors a shared pool with a small budget of its own, cap the size of each message, the history resent and the length of each answer, and limit requests per session. Keep the provider key on your server so the only route to the model runs through those limits, and set a hard limit on the provider account as the backstop.

It is used for two things. One is running out of an allowance: a quota, spend limit or rate limit on the account, after which the feature stops for everyone who shares it. The other is the model's context window: OWASP's Continuous Input Overflow is continuously sending inputs that exceed it, which can lead to excessive computational resource use. Caps on input size and on the history resent with each call address the second; per-user and per-tenant budgets address the first.

Because requests differ in cost. In the illustrative model on this page, one request with the limits missing costs about 54 times as many tokens as one with the limits in place. A request quota alone lets a user make every request as expensive as possible. Count both: requests for pace, tokens for cost.

Yes. Lower the limits for test accounts so that a handful of requests reaches each one, run in a test environment with its own provider project or workspace, and set a low hard spending limit there before you start. The five scenarios on this page are built that way. They show whether each limit exists and holds; how the system behaves under heavy load is a separate question for a load-testing specialist, with your host's written approval.

Scope the right test for your application

Tell us what you have built, who uses it and when it needs to launch. You will get a plain-English recommendation: a website audit, a web application test or a referral to a specialist.