Exposure Medium

Revoke the exposed Groq API key

A Groq API key (gsk_...) lets whoever holds it send requests on the account, using up its rate limits and, on a paid plan, its money. In a browser bundle it is available to anyone who loads the page.

Find out whether your site has this problem, and every other check, in one free scan.

Check your site free

Why it matters

A Groq API key lets whoever copies it send requests on the business's account, using up its rate limits and, on a paid plan, its money.

How to fix

  1. 1 Revoke the key in the Groq console (API Keys, delete it) and create a new one. Revoking is the only step that stops the copied key from working.
  2. 2 Move every call to Groq behind an endpoint on your own server that holds the new key, checks who is asking and limits how often.
  3. 3 Purge the old key from git history so it is not recoverable from a prior commit.
  4. 4 Redeploy and confirm the shipped bundle has no gsk_ key in it.

Common mistakes

  • Putting the key in a build-time environment variable and assuming that keeps it private: a bundler that inlines it (NEXT_PUBLIC_, VITE_, PUBLIC_) ships it to every visitor.
  • Removing the key from the current build without revoking it: copies in git history, old deploys and CDN caches keep working until it is revoked.
  • Assuming a free-tier key is harmless: someone else using up its rate limits breaks the feature for real visitors.

How to verify

  1. 1 Re-run the scan and confirm the Groq API key finding is gone.
  2. 2 Search the deployed JavaScript for gsk_ to confirm no key remains.
  3. 3 Confirm the old key no longer appears under API Keys in the Groq console.

Related checks

Ready to see where you stand?

Scan your site and get your Engineering Score with a prioritized roadmap in under a minute, no signup required.

Scan your site

Session expired

Your session has expired for security. Please log in again to continue.