Skip to content

My Groq key leaked. What do I do?

Short answer

Delete the key in the GroqCloud console's API Keys page, create a replacement stored only on your server, and check usage for requests you didn't make. Leaked inference keys get used to run free LLM traffic on your account and limits.

Last updated 2026-11-25 · Reviewed by ProofForge

Is it this key?

Format: gsk_

Blast radius: Inference requests billed to, or rate-limited against, your organization.

The first 10 minutes

WhenDoHow
0–2 minDeleteconsole.groq.com → API Keys → delete the leaked key.
2–4 minReplaceCreate a new key and set GROQ_API_KEY on the server. Redeploy.
4–8 minCheck usageReview usage and logs for unknown traffic. Set spend limits if available.
8–10 minClose the holeRemove the key from frontend code and git history.

Stop the next leak

  • Keep the key in a server-side env var. Never use a VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variable or hard-code it in frontend code.
  • Call the provider from your backend or an edge function, and add .env* to .gitignore.
  • Re-scan the live site after every deploy. Keys also leak through JS bundles, source maps and exposed .env or .git paths.

Check your live app

A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.

Read-only. No writes or row contents.

FAQ

Old deployments now fail with?

A 401 invalid API key error. See Groq's error codes.

Can I call Groq from the browser?

Not with a key in client code. Proxy through your server.

Is the Groq API OpenAI-compatible?

Yes, which is also why leaked keys are easy for others to use.

Sources

Related

Read as Markdown · Scan methodology