Skip to content
BrakeKey

10 min read · Updated 2026-11-29

My OpenAI key leaked: what to do in 10 minutes

A short ordered checklist for when your OpenAI key is in a screenshot, a GitHub repo, or the JavaScript of a Lovable, Bolt, or Replit app.

Treat the key as stolen the moment it might have been public. You do not need to prove someone used it before you revoke it. Revoking is reversible in the sense that you can create a new key. Leaving the old one alive is not.

Minutes 0 to 2 — revoke it

  1. Open the OpenAI platform API keys page while signed in as the owner.
  2. Find the key that leaked. The dashboard shows a hint of the key, not the full secret. Match the name, the project, and the date you created it.
  3. Revoke it. Create a replacement only after you know where it will live, and do not put the new one in the same file.
  4. If you are not sure which key it was, revoke the ones that were ever pasted into a chat tool or a client project. A spare unused key in a server secret can stay.

Minutes 2 to 4 — stop the bleed

  1. Open organization limits and set a monthly spend limit with Enforce a hard limit turned on. Do the same on the project.
  2. Open usage and look for a spike you do not recognize. Note the time. You will want it if you write to support.
  3. If the key was Anthropic, OpenRouter, Groq, or Google, revoke it in that dashboard too. The same rule applies: the browser must not be where the replacement lives.

Minutes 4 to 7 — remove the copies

  • Client code, including anything named NEXT_PUBLIC_, VITE_, or REACT_APP_.
  • The host's environment settings, if a “public” flag is on.
  • GitHub, including old commits. Deleting the latest commit does not delete the key from history. Revoking is what saves you. Cleaning the repo is so you do not redeploy the old key later.
  • Chat logs in Lovable, Bolt, Cursor, or Slack, if you pasted the raw key there. Those logs are not a vault.
  • Screenshots and README files. People really do commit the key “just for the demo.”

Minutes 7 to 10 — confirm

  1. Redeploy.
  2. Open the live site, view source, and search for sk-proj- and sk-.
  3. Send one chat message and confirm the request stays on your domain.
  4. Run a BrakeKey scan on the public URL. A grade of A or B, with no key finding, is the result you want. A grade of F means a copy is still public.

If money already left, the spending-limit page explains the error codes (organization_spend_limit_exceeded, project_spend_limit_exceeded, and the separate OpenAI-assigned usage limit). Support will ask for project id, times, and request ids. Do not paste the key into the support form.