Skip to content

Stripe Payments errorStripe: api_key_expired

api_key_expired is the Stripe error for a request made with a secret or restricted key that no longer works. Someone expired or rotated the key in the Dashboard, and part of the app still sends the old one.

Short answer

Open the API keys page in the Dashboard and get the current key. In live mode Stripe shows a secret or restricted key only once, so if nobody saved it, rotate or create a new one. Then replace the old key in every place that sends it: the server environment, background jobs, webhook handlers and any no-code tools. Redeploy so the new value loads. If the code is platform_api_key_expired, see the Connect platform cause below.

Rather not fix it yourself? Stripe Billing Fix and Setup handles it at a fixed price, agreed before work starts.

Why the key expired, and the fix

  1. 01

    Someone expired the key

    “If you expire a secret API key or a restricted API key, you must create a new one and update any code that uses the expired key.” Stripe, API keys (Expire an API key)

    An expired secret or restricted key stops working, and only a new key fixes it. Create one with the same permissions and swap it in.

  2. 02

    The key was rotated and the grace period ended

    “When you rotate a key in the Dashboard, both the old and new keys work for up to 7 days.” Stripe, API keys (Rotate safely to avoid downtime)

    Rotating a key gives you up to 7 days in which both keys work, or none if Now was chosen as the expiration. A server still on the old key fails once that time is up. Search every environment for the old key before the window ends.

  3. 03

    One place still has the old key

    “The API key provided has expired. Obtain your current API keys from the Dashboard and update your integration to use them.” Stripe, Error codes (api_key_expired)

    The site works, but a cron job, a second server or an automation tool fails. Each of them reads its own copy of the key, so update each one and restart it.

  4. 04

    A Connect platform key changed

    “This occurs if your platform has either generated a new key or the connected account has been disconnected from the platform.” Stripe, Error codes (platform_api_key_expired)

    Also check: platform_api_key_expired means the platform you connect through made a new key, or your account was disconnected from it. Get the current key, or reconnect the account.

Checked against the vendor’s docs on : Stripe docs: Error codes; Stripe docs: API keys.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

“Working with Simon makes everything run so smoothly and better than I could ask for it. Amazingly communicative, extremely knowledgeable of coding and the backend processes. I strongly recommend.”
A buyer in the United States, January 2026. App development on Fiverr
All 127 Fiverr reviews

Related: Stripe invalid API key provided · Stripe works in test mode, not live · Stripe webhook signature verification failed · Stripe Checkout Session expired

Questions

More on this error

Can a publishable key expire?

No. Stripe says you can’t expire a publishable key. This error comes from a secret or restricted key on your server.

Is it the same as Invalid API Key provided?

No. Invalid API Key is the message people usually see for a mistyped or wrong-mode key. api_key_expired is for a key Stripe did recognise and that was later expired or rotated out.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.