If you use Stripe to manage payments, subscriptions, or online checkouts, your API key is the bridge that connects Stripe to your website or app. Whether you’re setting up custom integrations, testing webhooks, or building a new automation, you’ll need your keys handy. In this quick guide, I’ll show you exactly how to find your Stripe API key safely and securely.
Stripe provides two sets of API keys — test and live. These determine whether you’re working in a sandbox environment or processing real payments.
Here’s how to access them step-by-step:
1. Log In to Your Stripe Dashboard
Go to dashboard.stripe.com and sign in with your credentials.
2. Navigate to the Developers Section
From the left-hand sidebar, click Developers → API Keys. This is where both your publishable and secret keys are stored.
3. Locate Your Keys
You’ll see two main types of keys:
-
Publishable Key (starts with pk_) – Used on the front end of your site.
-
Secret Key (starts with sk_) – Used on the server side for secure operations.
4. Copy the Key You Need
Click the small copy icon next to each key. Make sure you only share the publishable one with public scripts.
5. Toggle Between Test and Live Modes
At the top-right corner, you’ll find a toggle to switch between Test and Live environments. Use test mode for experiments, and live mode for production.
6. Keep Keys Secure
Store your keys in a secure environment variable, not directly in your code or public files.
7. Regenerate Keys (If Compromised)
If you ever suspect your keys have been exposed, click Roll Key to generate a new one immediately.
Pro Tips:
-
Always test payment flows in test mode before going live.
-
Use the Stripe CLI for local development and debugging.
-
Pair your keys with tools like Make.com or Zapier for seamless automation.
Your Stripe API keys are the gateway to everything your payment system can do. Handle them carefully, and you’ll unlock the full potential of Stripe’s developer tools with complete confidence.