Skip to content

Leaked Groq API key? What to do now

Revoke it first, then check what it was used for, cap what your keys can spend and clean up where it leaked. Every Groq step below comes from Groq's own docs, checked 17 Nov 2026.

Free. No sign-up.

Whose key leaked?
Where did it leak?

What to do now, for Groq

  1. Revoke the key now

    Revoke the key on the API keys page, then create a new one and redeploy. Keys belong to a project, so pick the right project in the console first. Do this first: until it's revoked, anyone who copied it can keep spending. GitHub reports Groq keys found in public repos to Groq, and its push protection can block them, but Groq's docs don't say it disables them.

    Groq API keys

  2. Keep the new key on the server

    Put the new key only in a server-side secret: your host's environment settings, your builder's secrets, or Supabase function secrets. Never in a variable starting NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_, which are sent to every visitor.

    Lovable secretsBolt secretsSupabase function secrets

  3. Check usage for charges that weren't yours

    The usage page shows usage by model for the project you have selected. Groq's docs don't say it can filter by key. Note the time the key leaked and the time you revoked it.

    Groq usage

  4. Cap what any key can spend

    On a paid plan, an organisation owner can set a monthly spend limit under Billing, then Limits. Once it's reached, every key in the organisation is blocked until the 1st of next month, or until you raise the limit. It can't be set per key, and spend updates every 10 to 15 minutes, so you can go a little over. Groq invoices usage afterwards, monthly or when it passes set amounts.

    Groq spend limits

  5. Clean up the repo, after revoking

    Remove the key from the code and the git history, but only once it's revoked: anyone who cloned the repo, or a fork, still has it. Then turn on push protection, so GitHub blocks the next key you try to push.

    GitHub: removing sensitive dataGitHub: push protection

  6. If someone ran up charges, ask for them back

    Email support@groq.com. Groq handles refunds case by case, and its services agreement makes you responsible for keeping your API keys safe and for any use of your account. Say when the key leaked, when you revoked it and which usage wasn't yours.

    support@groq.com

Checked in Groq's own docs. Sources: security onboarding, projects, billing FAQ, spend limits, services agreement. Dashboards move, so if a link is out of date, look for the same setting under account or organisation settings.

Then find every other copy, with your coding agent

Find every place an API key or other secret is exposed in this project, and fix it. Search the code, env files, config and local settings files (such as .claude/settings.local.json), the full git history (with gitleaks or a similar scanner) and the built browser bundle. Flag any secret in a variable with a public prefix such as NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_, and any AI provider called from browser code. Move every AI call into a server route or function that reads its key from a server-only variable, add .env and local settings files to .gitignore, and list each key that was exposed and where, so I can revoke it. Don't rewrite git history.

Questions

Does Groq disable a leaked key for you?

GitHub reports Groq keys found in public repos to Groq, and its push protection can block them, but Groq's docs don't say it disables them. Revoke it yourself either way.

Can I cap what a Groq key spends?

On a paid plan, an organisation owner can set a monthly spend limit under Billing, then Limits. Once it's reached, every key in the organisation is blocked until the 1st of next month, or until you raise the limit. It can't be set per key, and spend updates every 10 to 15 minutes, so you can go a little over. Groq invoices usage afterwards, monthly or when it passes set amounts.

How do I see what a leaked Groq key was used for?

The usage page shows usage by model for the project you have selected. Groq's docs don't say it can filter by key.

Will Groq refund charges from a leaked key?

Email support@groq.com. Groq handles refunds case by case, and its services agreement makes you responsible for keeping your API keys safe and for any use of your account.

How do I find where my Groq key leaked?

Search your code, your git history and your live site's JavaScript for “gsk_” (how Groq keys start). Common places are browser code, a committed .env or local settings file, and screenshots.

Other providers