Get Stripe API Keys: Test & Live (2026)
Published February 25, 2026 ยท Hatty AI ยท 5 min read
Find your Stripe publishable & secret API keys in 2 minutes. Step-by-step for test and live modes โ with security best practices.
Why You Need Stripe API Keys
Stripe API keys are essential for connecting your website or application to Stripe's payment processing infrastructure. Whether you're building an e-commerce store, a SaaS subscription platform, or a simple donation page, you'll need both Test and Live keys to develop and deploy your integration.
Test keys let you simulate transactions without moving real money, while Live keys process actual payments. This guide walks you through retrieving both sets of keys from your Stripe Dashboard.
๐ก Quick Tip
Always start development with Test keys. Switch to Live keys only when you're ready to accept real payments.
Step 1: Log in to Stripe
- Go to dashboard.stripe.com
- Sign in with your Stripe account credentials.
- If you don't have an account yet, click "Sign up" to create one โ it's free.
Step 2: Navigate to API Keys
Once you're in the Stripe Dashboard:
- Look at the left sidebar and click "Developers".
- Then click "API keys" from the submenu.
You'll now see a page listing your API keys. This is where you'll find both your Publishable key and Secret key.
๐ Navigation path: Dashboard โ Developers โ API keys
Step 3: Retrieve Your Test Keys
Test keys allow you to simulate payments without processing real transactions. Here's how to get them:
- At the top right of the dashboard, toggle "Test mode" to ON.
- You will now see your test keys displayed:
- Publishable key โ the test-mode publishable key shown in your Dashboard
- Secret key โ the test-mode secret key shown behind the reveal control
- Click "Reveal test key" to view the full Secret key.
โ What to copy
- Test Publishable Key
- Test Secret Key
Step 4: Retrieve Your Live Keys
Once you're ready for production, you'll need your Live keys to process real payments:
- Turn Test mode OFF using the toggle at the top right.
- You will now see your Live keys:
- Publishable key โ the live-mode publishable key shown in your Dashboard
- Secret key โ the live-mode secret key shown behind the reveal control
- Click "Reveal live key" to view the full Secret key.
โ What to copy
- Live Publishable Key
- Live Secret Key
โ ๏ธ Important Security Notes
- Never share your Secret Key publicly. Do not email it in plain text, post it on social media, or include it in client-side code.
- Your Publishable Key is safe to use in frontend code โ it can only create tokens, not charge cards.
- Your Secret Key belongs on your server only. It has full access to your Stripe account.
Best Practices for API Key Security
- Store Secret Keys in environment variables, never in source code.
- Use Restricted API Keys in production environments to limit permissions.
- Rotate your keys periodically and revoke any that may have been compromised.
- Use Stripe's webhook signing secrets to verify incoming events.
Using Restricted API Keys (Recommended for Production)
For production environments, Stripe recommends creating Restricted API Keys instead of using your main Secret Key. Restricted keys let you control exactly which API resources the key can access.
- Go to Developers โ API keys in your Stripe Dashboard.
- Click "Create restricted key".
- Name your key (e.g., "Website Payments" or "Subscription Manager").
- Select the specific permissions the key needs (Read, Write, or None for each resource).
- Click "Create key" and copy it immediately โ you won't be able to see it again.
Quick Reference: Key Types
| Key Type | Where It Belongs | Safe for Frontend? |
|---|---|---|
| Test Publishable | Frontend or checkout client code during test mode | Yes |
| Test Secret | Server environment variables only | No |
| Live Publishable | Frontend or checkout client code in production | Yes |
| Live Secret | Server environment variables only | No |
| Restricted | Server environment variables with scoped permissions | No |
Need Help?
If you'd like assistance retrieving your keys, setting up restricted keys, or configuring Stripe webhooks, the Hatty AI team is here to help.
Need hands-on assistance with Stripe integration?
Contact Hatty AIWe can also grant temporary access setup, walk you through webhook configuration, or build a complete Stripe integration for your platform.
Frequently asked questions
Where do I find my Stripe API keys?
Log in at dashboard.stripe.com, click Developers in the left sidebar, then API keys. That page lists your Publishable key and Secret key.
What is the difference between Stripe test and live keys?
Test keys let you simulate transactions without moving real money, while live keys process actual payments. Start development with test keys and switch to live keys only when you are ready to accept real payments.
How do I see my Stripe test secret key?
Toggle Test mode on at the top right of the dashboard, then click Reveal test key to view the full secret key.
Free review
Get a free review from an engineer
Tell us where your team loses the most time. Our engineers review your current setup and send back a prioritized plan for automation, software and security.
- Reviewed by an engineer, not a bot
- Prioritized by time saved and risk reduced
- No obligation and no pressure
Prefer to talk? Call (210) 227-3444 or book a strategy session.
