Leaked an API key? › Groq
Leaked Groq API key: what to do in the next 10 minutes
Last updated: November 18, 2026. Steps checked against Groq's own docs on November 18, 2026.
Short answer: Revoke the leaked key on the API Keys page of the Groq Console (console.groq.com/keys) first: Groq's security docs say to revoke a key immediately if you suspect it is compromised and never to reuse it, even temporarily. Then create a new key, put it only in a server-only environment variable such as GROQ_API_KEY, never in frontend code, a browser bundle or a VITE_ or NEXT_PUBLIC_ variable, and redeploy. Then review your app and service logs for calls you didn't make. If the leaked key's row is still listed, its Last Used and Usage (24hrs) columns are clues, not proof of who made a call. A SniffPup scan of a site you own can help find a remaining exposed gsk_ key in public pages, but it cannot confirm the key is absent everywhere or that the site is secure. Removing the key from code alone does not un-leak it.
Which Groq keys are secret?
- Secret: Groq API keys. Groq's own examples show them starting with gsk_. They authenticate every Groq API call, so anyone holding a leaked key can make calls as your organization.
- Secret: Groq's API also works with OpenAI's client libraries (you pass the Groq key and point base_url at https://api.groq.com/openai/v1), so a gsk_ key can turn up in code that looks like an OpenAI client. It is still a Groq key.
- Meant to be public: None. Groq says never to embed keys in frontend code or expose them in browser bundles, and to route client-side use through a trusted backend proxy.
The next 10 minutes
Times are a rough guide. Do the first step before anything else.
1. Revoke the leaked key (Minutes 0-2)
- Open the API Keys page in the Groq Console (console.groq.com/keys), find the leaked key by its name and created date, and revoke it. Groq's incident response steps start with revoking the key immediately from the Groq Console. Groq API calls that use the revoked key will fail, so any integration using it needs a valid replacement.
- Groq says never to reuse a compromised key, even temporarily, so don't keep it around as a fallback.
- Only team owners or users with the developer role can create or manage API keys. If you can't revoke it, ask an owner on your team to do it now.
2. Create a server-only replacement (Minutes 2-5)
- Create a new key on the same page and give it a clear name. Groq recommends separate keys per environment (dev, staging and prod), so a leak of one environment's key doesn't force you to replace the others.
- Store the new key only in an environment variable or a secret manager on your server, for example GROQ_API_KEY, which Groq's SDK examples read and the AI SDK's Groq provider looks for by default. Never put it in client JavaScript, a mobile app, a public repository, or a VITE_ or NEXT_PUBLIC_ variable. Call Groq from your backend, then redeploy so the public bundle no longer ships the old key.
3. Check usage for calls you didn't make (Minutes 5-8)
- Groq's incident steps say to review your logs for suspicious activity: check your app and service logs for calls you didn't make, and note times and amounts. The API Keys page shows Last Used and Usage (24hrs) per key; if the leaked key's row is still listed, treat those columns as clues, not proof of who made a call.
- On a paid plan, an organization owner can set a monthly spending limit with email alerts under Settings, Billing, Limits. Groq says the limit covers your whole organization, not one key, that it is monthly only, and that spend tracking runs 10-15 minutes behind, so you can go a little over before calls are blocked.
- If you see usage you don't recognize, contact Groq with the times and amounts. That is our advice, not a step from Groq's docs, and we can't promise how Groq will handle charges from a leaked key.
4. Clean up and re-check (Minutes 8-10)
- Remove the key from frontend code, public files, notebooks, screenshots, CI logs and git history. History can keep a secret after the file is deleted. Rotate any other secrets that sat in the same file or commit.
- Deleting the key from a repo does not revoke it. Revoke it in the Groq Console. Close the leak path so the replacement never ships to the browser.
- Re-scan the live site you own. A passive scan can help find a remaining exposed gsk_ key in public pages. It cannot confirm the key is absent everywhere, and a clean report is not a guarantee of security. Don't paste the full secret into chat.
Good to know
- The scan flags strings that look like a Groq API key (a word-bounded gsk_ followed by at least 40 ASCII letters or digits) in HTML, inline scripts or same-origin JavaScript bundles, and shows them masked. It doesn't check whether a key works and never uses a key it finds.
- Groq's security docs also suggest rotating keys on a schedule (for example quarterly) and logging every key creation and deletion.
- Replacing a key without removing it from client bundles or public .env files exposes the new key the same way.
- The scan is passive and read-only on a live URL you own or are authorized to test. It is not a security guarantee.
After the first 10 minutes
Move the code that needs the key to the server (an API route, serverless function or Supabase Edge Function), keep the key in a server-only environment variable, redeploy, and re-check your live site. The general plan, with a prompt you can paste into Lovable, Bolt, Cursor or Claude Code, is in I leaked an API key in my vibe-coded app. What do I do now? Not sure what kind of key you found? Check it with What kind of key is this?
What SniffPup checks, and what it doesn't
A free SniffPup scan reads only what your live site serves to the public: secret key patterns in HTML and same-origin JavaScript (masked in the report) and public files such as /.env and /.git/config. It never uses a key it finds. It can't see your repo, your server or Groq's logs, so the steps above are always on you. A clean report is not a guarantee of security.
Sources
- Groq Docs: Security Onboarding (key management, rotation and revocation, incident response)
- Groq Docs: Spend Limits
- Groq Docs: Quickstart (GROQ_API_KEY)
- Groq Docs: OpenAI Compatibility
- GroqCloud: API Keys
Groq can change its dashboard and steps at any time. If something here doesn't match what you see, follow Groq's docs and tell us.
Other providers
- Leaked OpenAI API key: what to do in the next 10 minutes
- Leaked Anthropic API key: what to do in the next 10 minutes
- Leaked Gemini API key: what to do in the next 10 minutes
- Leaked Resend API key: what to do in the next 10 minutes
- Leaked Perplexity API key: what to do in the next 10 minutes
- Leaked OpenRouter API key: what to do in the next 10 minutes
- Leaked ElevenLabs API key (unauthorized charges): what to do
- Leaked Stripe secret key: what to do in the next 10 minutes
- Leaked Supabase service_role or secret key: next 10 minutes
- Leaked AWS access key: what to do in the next 10 minutes
- Leaked GitHub token: what to do in the next 10 minutes