Stripe-Account header for the connected acct_ account.Stripe Connect Api Key Invalid
Quick answer: do not swap publishable keys, restricted keys, platform keys, and connected-account context. For connected-account calls, authenticate with the platform secret key and pass the connected account ID in `Stripe-Account`; for ordinary account calls, use the current secret key from the same mode as the request.
Why This Happens
- The code is sending a publishable key or deleted/rotated secret key to the API.
- A test key is being used against live data, or a live key against test data.
- A Connect request is missing the `Stripe-Account` header for the connected account.
What To Check First
- Check whether the key starts with `sk_test_` or `sk_live_` and matches the request mode.
- Confirm the key is loaded only on the server, not in client-side browser code.
- For Connect, log the connected account ID and verify the `Stripe-Account` header starts with `acct_`.
When To Escalate
- The problem is costing you money or customers per week
- You've spent more than 2 hours on it without progress
- A vendor quoted you more than $500 and you're not sure if it's necessary
FAQ
- Why is my Stripe Connect API key invalid? Per Stripe authentication docs, Sept 2026, API requests fail without valid authentication. Check that the secret key is current, server-side, and from the same live or test mode as the request.
- How do I make a Stripe Connect request for a connected account? Per Stripe authentication docs, Sept 2026, use your platform secret key and include the `Stripe-Account` header with the connected account ID, usually starting with `acct_`.
- Can I expose a Stripe secret key in browser code? No. Per Stripe authentication docs, Sept 2026, secret API keys carry many privileges and should not be shared in publicly accessible places such as client-side code or GitHub.
Dealing with this right now?
Text PJ a quick description — real human, San Diego, straight answer.