← 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

How to fix it

  1. Copy the secret key again from Dashboard → Developers → API keys, with no quotes or trailing spaces.

  2. Keep secret keys server-side only:

    # .env.local
    STRIPE_SECRET_KEY=sk_test_...
    NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
  3. Update the variable on your host (e.g. Vercel) and redeploy.

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy