Terms & acceptable use
🔑 Free key check

Paste your live app link. We look for secret keys in the code your site sends to every visitor. Free.

FreeJust your email to see results10 seconds

The free scan shows your problems. The $9 fix report gives you a copy‑paste fix prompt for each one.

Guide · API keys · Updated

How to Check if Your API Key Is Exposed on Your Website

If your app runs in a browser, every visitor downloads its code. If a secret key is in that code, anyone can copy it. Here is how to check your live app in about 5 minutes, for free.

1. The short answer

Open your live site. Open your browser dev tools. Search all the files the page loaded for the start of your key, like sk- or sk_live_. If you can find it, so can anyone.

Some keys are made to be public. Secret keys are not. A secret key in the browser lets a stranger use your account, and you get the bill.

2. Which keys are secret?

Use this table to tell them apart. The start of the key is the clue.

KeyStarts withOK in the browser?
OpenAIsk-sk-proj-Secret. Server only.
Anthropicsk-ant-Secret. Server only.
Stripe secretsk_live_sk_test_rk_live_Secret. Server only.
Stripe publishablepk_live_pk_test_Public. Fine in the browser.
Supabase service_role / secreteyJ… (service_role)sb_secret_Secret. It skips all table rules.
Supabase anon / publishableeyJ… (anon)sb_publishable_Public. Your table rules keep you safe.
AWS access keyAKIAASIASecret. Server only.
GitHub tokenghp_github_pat_Secret. Server only.
Google API keyAIzaOften public (Maps, Firebase). Add limits to it.

A Supabase anon key and a service_role key both start with eyJ. To tell them apart, compare them with the keys in your Supabase dashboard under Project Settings → API Keys.

3. The 5-minute check on your live site

Only check apps you own or have permission to test.

Step 1: Search the code your page loads

Open your live app in Chrome. Right-click and pick Inspect. Press Ctrl+Shift+F (Cmd+Option+F on a Mac) to search all loaded files. Search for each of these, one at a time:

  • sk- and sk-ant- (OpenAI and Anthropic)
  • sk_live and rk_live (Stripe secret keys)
  • service_role and sb_secret_ (Supabase keys that skip your table rules)
  • AKIA, ghp_ and secret (AWS, GitHub and other secrets)

Click around a few pages first, like login and settings. Some code only loads when you open those pages.

Step 2: Watch where your app sends requests

In dev tools, open the Network tab and reload. Use the part of your app that uses AI or payments. Look for requests that go straight from the browser to api.openai.com, api.anthropic.com or api.stripe.com. Click one and look at the request headers. If you see Authorization: Bearer sk-…, your secret key is public.

The safe way is for your browser to call your own server or edge function, which then calls the paid API.

Step 3: Try /.env and /.git/config

Open a private window. Go to yourapp.com/.env, then yourapp.com/.git/config. You should get a "not found" page or your normal app page. If you see lines like OPENAI_API_KEY=… or [core], those files are public. Remove them from the live site and make new keys.

Step 4: Check your variable names

Open your project settings or .env file. Any name that starts with VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ gets built into the code every visitor downloads. A secret should never have one of those names. See which env vars end up in the browser.

Step 5: Check GitHub and your usage

If your code is on GitHub, look at the Security tab of your repo for secret scanning alerts. Keys can also hide in old commits. Then open each provider's dashboard (OpenAI, Stripe, and so on) and look for usage you don't recognize.

4. If your key is exposed

Do these in order:

  1. Make a new key and turn off the old one. Do this in your provider's dashboard first. Removing the key from your code does not help if someone already copied it.
  2. Move the key to the server. Put it in a server-side function, like a Supabase Edge Function or an API route, and store it as a server secret.
  3. Set a spending limit. In OpenAI, set a monthly budget and email alerts. In Google Cloud, set a budget alert and add limits to each key. A budget alert warns you. It does not always stop spending by itself.
  4. Check your bill. Look for charges you don't recognize, and contact the provider's support if you find any.
  5. Check again. Run the 5-minute check on your live site again after you ship the fix.

Step-by-step rotation for OpenAI, Stripe, Supabase and Google keys: I leaked my API key. What do I do now?

Taking payments? See Is my Stripe key safe in my frontend? pk_live vs sk_live.

Using Clerk for login? See Is my Clerk secret key safe?

Found an sk-ant- key or a Claude chatbot calling Anthropic from the browser? See Is my Anthropic API key safe in my frontend? Using Gemini or Google AI Studio? See Is my Gemini API key safe in my frontend?

Sending texts or sign-up codes with Twilio? See Is my Twilio Auth Token safe in my frontend?

Sending email with Resend or SendGrid? See Is my Resend key safe in my frontend?

Found an AKIA key from an S3 upload? See Is my AWS access key safe in my frontend?

Is the AIza key for a map or address search? See Is my Google Maps API key safe in my website?

Is the AIza key the apiKey from your Firebase config? Firebase says that one is public by design, and your Security Rules are what protect your data: Is my Firebase app secure?

Also check your database. A Supabase app can leak data even with no secret key in the code, if a table has no rules. See Is my Lovable app safe? for the table check.

5. Copy-paste fix prompts for Lovable, Bolt and Cursor

Paste one into your AI builder. After the fix, make new keys and run the check again.

Lovable or Bolt: move secret keys to the server
Find every secret API key in my frontend code, like OpenAI, Anthropic, Stripe secret keys (sk_ or rk_), and the Supabase service_role or secret key. Move each one into a server-side function, like a Supabase Edge Function, and store the key as a secret there. Change the app to call that function instead. Make sure no secret is in a variable that starts with VITE_ or NEXT_PUBLIC_. Then list every key you moved so I can make a new one.
Any builder: stop calling OpenAI from the browser
My app calls the OpenAI API straight from the browser, so my key is public. Create a server-side endpoint that calls OpenAI with the key stored as a server secret. Only let logged-in users call it, and add a simple limit on how many calls each user can make per hour. Update the frontend to call my endpoint, not OpenAI.
Cursor: find keys in my code and history
Search this whole project for API keys and secrets: anything starting with sk-, sk_live_, rk_live_, sb_secret_, AKIA, ghp_ or github_pat_, plus any service_role key. List the file and line for each one. Do not print the full key. Then tell me which ones are in files that get sent to the browser, and how to remove them from my git history.

6. Check it for me

Don't want to search by hand after every change? VibeCheck checks your live app from the outside, the way a stranger would. It searches the JavaScript your homepage loads for secret keys like OpenAI, Anthropic, Stripe, AWS, GitHub and Supabase service_role keys. It also checks for open Supabase tables, security headers, Google basics and broken links.

It only looks. It never logs in, fills in forms or tries to break in. It shows only part of any key it finds, so the report itself never leaks it.

Pricing: the problems list is free (just add your email). A fix report with a copy-paste prompt for every problem is $9. Or get 10 fix reports for $29. No subscription.

No tool can promise your app is safe. VibeCheck catches common, costly mistakes so you can fix them first.

7. FAQ

How do I know if my API key is exposed on my website?

Open your live site, open your browser dev tools, and search all loaded files for the start of your key, like sk- for OpenAI or sk_live_ for Stripe. Also watch the Network tab for calls that go straight from the browser to a paid API. If you can see the key, anyone can.

Is it safe to put an API key in frontend code?

Only if the key is made to be public. Stripe keys that start with pk_, the Supabase anon or publishable key, and Firebase web keys are meant to be in the browser. Secret keys, like OpenAI keys or Stripe keys that start with sk_, must stay on a server.

Does hiding a key in a .env file keep it safe?

Not always. A .env file keeps the key out of your code, but some names get built into the code every visitor downloads. In Vite apps that is any name starting with VITE_. In Next.js it is any name starting with NEXT_PUBLIC_. Never put a secret in one of those.

What should I do first if my key is exposed?

Make a new key and turn off the old one in your provider dashboard. Do this first, before you change any code. Removing the key from your code does not help if someone already copied it.

Can bots really find my key?

Yes. Bots scan public websites and code on GitHub for key patterns all day. A leaked key can be used to run up a bill in your name, sometimes within hours.

Do I need a tool to check?

No. You can do every step in this guide by hand for free. A tool like VibeCheck runs the same kind of checks on your live app for you, and gives you a fix prompt for each problem.

More questions? See the VibeCheck FAQ. Built your app with Cursor? Read Is my Cursor app secure? for the NEXT_PUBLIC_ and VITE_ rules and what .cursorignore does not protect. Before you launch, run the vibe coding security checklist (12 checks for any AI-built app).