API Security

AI API Credits Draining for No Reason? A Five-Step Triage

AI credits draining for no reason, or a balance that leaks like a faucet? Don't rotate keys first — open the usage page and pull daily line items, then classify. This five-step triage separates key leaks, browser extensions and third-party proxies, with Cloudflare observability signals, reconciliation tips and what to bring to a provider appeal.

Short answer: Read the usage curve before you touch anything. Credits draining for no reason is not proof of theft. Open the provider’s Usage page and pull daily line items by model: if an expensive model is running while you are offline and calls come from unfamiliar networks, suspect a key leak; if the anomaly starts the day you installed a “free GPT accelerator” extension, suspect a browser add-on binding your account or harvesting your key; if an unknown third-party relay or mirror shows up in connected apps, its backend may be running batch jobs. Classify first, then run the five steps — pull usage, rotate keys, disable extensions, revoke third-party authorizations, change password plus 2FA — and watch the curve for 1–2 days.

Classify first: unusual credit burn does not automatically mean theft

The first reaction to “my balance is leaking” is usually “I’ve been robbed.” Resist it. A model version change, a billing adjustment or a new teammate can all move the curve upward, and none of those are security incidents. The right order is read the curve, classify the cause, then act.

Use the table below to match the observable signals — each culprit leaves a different trace:

Culprit Typical scenario Observable signal
Key leak A key in an environment variable, repo or front-end bundle is extracted and resold Usage diverges from the business curve; an expensive model runs while you are offline; source geographies or ranges differ from history
Browser extension A “free GPT accelerator / unlock premium models” add-on binds your account, harvests your key or hijacks the session Anomaly starts when the extension was installed; unfamiliar devices or sessions appear; new entries show up in connected apps
Third-party relay You gave your key or account authorization to a mirror/relay that now runs batch or distillation jobs in the background An unknown app appears in the authorization list; calls concentrate on a few expensive models with batch-job characteristics; egress IPs belong to unknown proxy ranges

A one-line rule: calls up while business is flat looks like a leak; a start date that lines up with an extension install looks like a plugin; an unknown app in the authorization list looks like a relay.

The five-step triage: from classification to containment

Work through these in order and keep a screenshot or note at each step — you will need them for a provider appeal.

  1. Pull usage and classify. On the provider’s Usage / Billing page, export daily line items and note which expensive model ran while you were offline, and from which IP or region. Observe only at this stage; change nothing yet.
  2. Revoke all API keys and reissue them. In the provider console, revoke every suspicious key, then issue fresh ones. Send the new keys only to services that genuinely need them, and set a hard spend cap up front. Note that revocation only counts when done at the issuer (the provider console).
  3. Disable unfamiliar browser extensions. Check extensions in every browser you use, especially “free accelerator”, “unlock model” and “share credits” add-ons — disable first, then observe. Corporate environments should enforce an extension allowlist.
  4. Revoke all third-party relay and mirror authorizations. In your account’s Connected Apps / Authorizations list, remove every third-party grant you do not recognize, including relays, mirrors and aggregators you once tried.
  5. Change to a strong password, turn on 2FA, and watch for 1–2 days. After the first four steps, reset the account password and enable two-factor authentication, then see whether the curve settles. If expensive-model calls continue while you are offline after 1–2 days, repeat step 2 and prepare an appeal.
What you observe Most likely cause Jump to
Expensive model runs while you are offline, unfamiliar source IP Key leak Step ②, then check step ④ authorizations
Anomaly starts when a particular extension was installed Browser extension binding or harvesting a key Step ③, then back to step ② to reset
Unknown relay or mirror in the authorization list Third-party proxy running background jobs Step ④, then rotate the key
Usage tracks the business curve; only the unit price changed Pricing / billing change, not a security event No incident handling needed
Provider usage and your own logs disagree Counting method or retries — needs an appeal See next section
Five steps in order: keep a screenshot or note at each step for an appeal Step 1 · Pull usage and classify Find which expensive model ran while you were offline Usage screenshots Step 2 · Revoke and reissue keys Revocation counts only at the provider console New keys with spend caps Step 3 · Disable unfamiliar extensions Disable first, then observe — especially "accelerators" Extension allowlist Step 4 · Revoke third-party grants Remove every unknown app in Connected Apps Clean authorization list Step 5 · Strong password + 2FA Watch 1–2 days; if it persists, return to step 2 Settled usage curve
Figure 1: Work through the five steps in order. A matching signal may let you classify early, but do not skip the revocation in step 2 or the observation in step 5.

When to escalate to the provider

When provider-side usage and your own logs do not add up, separate three things before filing an appeal:

  • Token-counting method: whether input and output tokens are priced separately, whether cache-hit tokens are counted, and whether model multipliers line up. The same request under two different methods can differ noticeably.
  • Client retries: when the network jitters, an SDK’s automatic retries bill again, which can look like doubled usage without any theft.
  • Actual compromise: unfamiliar source + expensive model + offline hours together is what makes theft more likely than the alternatives.

According to reports, in October 2026 developer platform Railway suffered a security incident in which attackers decrypted environment variables for up to about 1.85% (roughly 100,000) of workspaces, specifically hunting AI provider API keys and running up about $740,000 in unauthorized usage. Refund policies differed by provider — some refunded under fraud policies, others reviewed cases individually (sources at the end). The same incident therefore produced different loss outcomes at different vendors, so any reduction or refund is at the provider’s discretion — do not assume it will be returned.

For an appeal, bring materials: a timeline (when the anomaly began and ended, and when you ran the five steps), the likely exposure path (where the key was stored, which extensions you installed, which sites you authorized), and usage screenshots (Usage line items, models and IPs for the anomalous window). The more specific the evidence, the easier it is for the provider to tell a counting discrepancy from real misuse.

Cloudflare capabilities vs. what your application must own

For credit anomalies, Cloudflare gives you network-side corroboration, not the AI provider’s billing ledger. Plan details below follow the reference article on this site; defer to the official documentation for current figures:

Item What Cloudflare provides Plan detail (defer to current official docs) What your application / provider must do
Anomaly signals Bot signals, from Bot Fight Mode on Free to Bot Management on Enterprise Varies by plan Provider Usage line items and usage-alert rules
WAF hits WAF custom rule match logs Custom rule counts: Free 5 / Pro 20 / Business 100 / Enterprise 1,000; regex from Business Rule maintenance and false-positive triage
Rate-limit hits Rate limiting rule match counters Rules: Free 1 / Pro 2 / Business 5 / Enterprise 100; IP-only characteristics on Free/Pro, richer from Business; counters are per-data-center with a few seconds of mitigation delay Authoritative ledger: per-minute, daily and total budget
Reconciliation logs Logpush to R2 for WAF and rate-limit logs Billed by plan and storage usage Align CF logs with the provider bill on a timeline
Credit ledger — (CF does not hold the AI provider’s billing ledger) — Usage and invoices in the provider console
Key management mTLS (Cloudflare-managed CA on all plans; BYO CA Enterprise-only, max 5) See left Key rotation and revocation, per-key quotas
Extension audit — — Browser extension allowlist and endpoint investigation

The takeaway: the credit ledger lives at the provider, key management is yours, and extension auditing happens on the endpoint. Cloudflare can only help you line up “what happened on the network” with the billing timeline — it cannot tell you how the money was spent.

Boundaries and non-applicable cases

  • Unusual credit burn is not always a security event: pricing changes, model swaps and team growth all move the curve. Read the curve before classifying, and do not revoke keys in a way that breaks production.
  • You cannot claw back usage already incurred: rotating keys stops the bleeding but cannot undo credits consumed during the exposure window. Refunds depend on provider policy — never assume one is coming.
  • Extension auditing has limits: Cloudflare logs cannot tell you what an employee installed in their browser. That needs endpoint management or manual, machine-by-machine checks.
  • CF cannot stop “valid requests with valid credentials”: when an attacker uses a real key and the request matches the contract, WAF and Bot signals may both look normal; reconciliation has to return to the provider ledger.

FAQ

Does a credit drop always mean I was robbed? No. Look at the usage curve first: calls up while business is flat, concentrated on expensive models during your offline hours, points to theft. If only the unit price or billing method changed, that is an invoice issue, not a security incident.

Is rotating the key enough? No. Rotation stops ongoing abuse of the leaked string, but if the new key has no spend cap, goes to the same services and the browser extension is still installed, the leak path is unchanged. Rotate together with setting caps, disabling extensions and revoking authorizations.

Can a browser extension really steal my credits? Yes. A common pattern is a “free GPT accelerator” add-on that binds your account after login, harvests or records your API key, or hijacks the session to call expensive models in the background. Clues: the anomaly starts when the extension was installed, and unfamiliar devices or authorizations appear.

Will the provider definitely refund me after an appeal? Not necessarily. First separate token-counting differences, client retries and real misuse, then submit a timeline, the exposure path and usage screenshots. Refunds and reductions are decided by each provider under its own policy — even in the same public incident, vendors differed.

Run the same check on your domain

Enter a domain and see its DNS hosting, mail authentication and Cloudflare status in 30 seconds. Free, public records only.

Public DNS records only. No intrusive scanning. · Used only to send this diagnosis — no marketing blasts.

Sources

Official Cloudflare documentation. Where this article mentions availability, quotas or limits, these pages are the source of truth. Cloudflare features change over time — confirm what is visible in your dashboard before committing to a design.

← Back to articles

Authorized Cloudflare Partner

Making an architecture decision for overseas markets?

Enterprise tier selection, architecture consulting, risk assessment — tell us the scenario and we will map a concrete path.

As a Cloudflare partner, we provide:

Book a consultation