Skip to content

LLM API key detector

Free, no sign-up Runs in your browser

Paste code, a notebook or a config and find OpenAI, Anthropic, Hugging Face, Google, Groq and other AI provider keys by format. Keys are shown redacted.

Checked as you type. Nothing you paste leaves this page, and keys are shown redacted.

The file is read in your browser. It is not uploaded.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the LLM API key detector

  1. Paste the text, code or config, drop a file, or load the example.
  2. For each key found, revoke it in the provider’s console first.
  3. Create a new key and store it in a secret manager or an environment variable.
  4. Check where the old key had been: git history, logs, shared notebooks.

About this tool

API keys for model providers leak the same way as other secrets, with one difference: they are worth money at once. A key pasted into a notebook, a README, a front-end bundle or a screenshot gets found by bots and used to run someone else’s workload on your bill, or to read what your account has stored.

Most providers give their keys a fixed prefix so that scanners can find them. This detector looks for those shapes: OpenAI (sk-proj-, sk-svcacct-, sk-admin- and the legacy sk- form), Anthropic (sk-ant-), Hugging Face (hf_), Google (AIza), Groq (gsk_), Replicate (r8_), OpenRouter (sk-or-v1-), xAI (xai-), Perplexity (pplx-), NVIDIA (nvapi-), LangSmith (lsv2_) and Pinecone (pcsk_).

Each hit is listed with the provider, the line and where to revoke it. The key itself is never repeated: you see the prefix, the last two characters and the length. Keys with no fixed prefix cannot be recognised by shape, so a clean result is not proof. For keys of other services, use the secret scanner.

Sources

Questions

What does an OpenAI API key look like?

Current keys start with sk-proj- for project keys, sk-svcacct- for service accounts and sk-admin- for admin keys, followed by a long string of letters, digits, hyphens and underscores. Older user keys are sk- followed by 48 characters. Several other providers also use an sk- prefix, so the prefix alone does not prove the provider.

What does an Anthropic API key look like?

It starts with sk-ant-, then a type and version such as api03, then a long string. The sk-ant- prefix is specific to Anthropic, which lets secret scanners identify these keys reliably.

I pushed an API key to GitHub. What should I do?

Revoke the key in the provider’s console at once and create a new one. Removing the commit is not enough, because public repositories are scraped within minutes and the key remains in history and forks. Then check the provider’s usage page for activity you do not recognise.

Where should LLM API keys be stored?

On the server side only, in a secret manager or an environment variable that is set at deploy time. Never in front-end code, a mobile app or a notebook you share, because anything shipped to a client can be read by the client. Give each environment its own key so one can be revoked without stopping the rest.

Related tools