Practical guide · By Aurelio Avila · November 4, 2026
I pasted an API key into ChatGPT: what to do now
It happens to careful people: a stack trace, a config snippet or a copied command carried a live key into a chat. Here is what to do in the next ten minutes, in order, and what you can safely skip.
Do these four things, in this order
- Revoke or roll the key at the provider that issued it. This is the only step that makes the pasted value useless. Deleting the message or the whole conversation does not revoke anything, and you cannot know who or what has already read the text. Do this first, before you look for anything else.
- Create a replacement and update the places that used the old key (your app's environment variables, your CI secrets, your deploy settings). Keep the new value in an environment variable or a secret manager, not in the file you were debugging.
- Check usage for the window the key was exposed. Look at the provider's usage page, billing page and audit or access logs for calls you did not make, and set a spending limit if the provider offers one.
- Find where the key lives besides your clipboard. The text you copied came from a file, a log or a terminal. If that file is in a Git repository, the key may be there too: see what to do after committing an API key to GitHub, or run a free public repository check (3 a day, values always masked).
Revoking is the fix whether the key went into ChatGPT, Claude, Gemini, Perplexity or a support ticket: the exposure is the same, a secret now sits in a place you do not control.
Where to revoke, by provider
Each row links to the Redaxa detector page for that key type, which lists the format, the near misses and the provider's own revocation steps. Menu names change over time, so use the provider's current dashboard.
| Key | What to do |
|---|---|
OpenAI API key (sk-proj-) | Delete the key on the API keys page of your OpenAI project, create a new one, then review the usage page. |
Anthropic API key (sk-ant-) | Delete or disable the key in the API keys section of the Anthropic Console, create a new one, then review usage and cost. |
GitHub token (ghp_, github_pat_) | Delete the token under Settings, Developer settings, then review your account's security log. |
AWS access key (AKIA) | Make the key inactive in IAM, create a new one, then review CloudTrail for the exposure window before deleting the old key. |
Stripe secret key (sk_live_) | Roll the key in the Stripe Dashboard under Developers, API keys, then review recent API activity. |
| Slack token or webhook | Revoke the token or regenerate the webhook URL in your Slack app settings. |
Database or app secret (DB_PASSWORD, JWT_SECRET) | Change the password or signing secret at its source and restart the services that use it. Rotating a signing secret invalidates the sessions or tokens it signed. |
What about the chat itself?
Delete the conversation if you like, and look at the data and privacy controls of the AI service you used: what is retained, and whether chats can be used for training, depends on the product, the plan and the settings, and those rules change. Read the provider's current policy rather than relying on this page. None of that replaces step 1. A deleted chat is a good habit; a revoked key is the actual protection.
If the key sat in a shared conversation link, a screenshot, a pasted ticket or a team workspace, revoke it for the same reason and remove the shared copy as well.
Stop it happening again
Most pasted keys travel inside something else: a stack trace, a .env snippet, a copied curl command. Paste the lines that matter, not the file, and keep the variable name while replacing the value: OPENAI_API_KEY=[SECRET] still gives the assistant what it needs. The full routine is in How to stop API keys leaking into AI prompts.
Redaxa's free Chrome extension checks the message when you press Enter or Send in ChatGPT, Claude, Gemini or Perplexity and stops it if something needs a look. Free checks run in your browser. With a Pro or Business plan the check runs on Redaxa's server so team policies apply; the text is not stored and not forwarded to an AI provider. It recognises keys with a known prefix or format and secrets assigned to telling names such as API_KEY; it cannot recognise a random string pasted on its own, and it does not test whether a key is still live.
FAQ
I pasted an API key into ChatGPT. Do I need to revoke it?
Yes. Treat any real key that left your machine as exposed and revoke or roll it with the provider that issued it. Deleting the chat does not revoke the key.
Does deleting the conversation make the key safe again?
No. Deleting a conversation removes it from your history; it does not make the key invalid, and you cannot tell what has already read it. Only revoking the key does that.
How do I know if someone used my key?
Check the provider's usage, billing and audit logs for calls you did not make during the time the key was exposed. For AWS that means CloudTrail; for OpenAI, Anthropic and Stripe, the usage and API activity pages.
Was it a real key or a placeholder?
If it was an obvious placeholder such as sk-your-key-here, there is nothing to revoke. If you are not sure, assume it was real; revoking a key you can replace costs a few minutes.