← All errors · Stripe
Invalid API Key provided
Exact error
Invalid API Key provided: sk_test_****
What it means
Stripe rejected the secret key sent with the request (authentication_error).
Likely causes
- Typo, extra whitespace or quotes around the key in your env file.
- Key was rolled/deleted in the Dashboard.
- Using a publishable key (pk_) where a secret key (sk_ or rk_) is required.
How to fix it
Copy the secret key again from Dashboard → Developers → API keys, with no quotes or trailing spaces.
Keep secret keys server-side only:
# .env.local STRIPE_SECRET_KEY=sk_test_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...Update the variable on your host (e.g. Vercel) and redeploy.
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy