Stripe api_key_expired: The API key provided has expired

Stripe returns api_key_expired? That API key has expired. Stripe says to take the current keys from the Dashboard and update the integration.

Reviewed October 21, 2026

What it means in plain English

Stripe's error-code list defines api_key_expired as: the API key provided has expired. Obtain your current API keys from the Dashboard and update your integration to use them.

A different code, platform_api_key_expired, means the API key provided by your Connect platform has expired. Stripe says that happens when the platform generated a new key, or the connected account was disconnected from the platform. secret_key_required means the call used a publishable key. See Stripe secret_key_required: a publishable key called a secret API.

Likely causes

  • The server still has a key you rolled or that Stripe expired.
  • A Connect platform is calling with platform_api_key_expired, which is the platform key or a disconnected account.
  • The key and the object are in different modes. Stripe's code for that is livemode_mismatch: test and live mode keys, requests, and objects are only available within the corresponding mode. See Stripe error: No such price / No such customer (resource_missing).

How to fix it, step by step

  1. Read the error code. Follow this page for api_key_expired. For platform_api_key_expired, Stripe says to update the integration with the current keys, or contact the user and reconnect the account.
  2. In the Stripe Dashboard, copy the current API keys.
  3. Put the secret key in the server environment the integration reads. Keep it off the publishable-key path. The secret-key page is the one for a pk_ key used on a secret call.
  4. Redeploy after the value changes. See Changed an environment variable on Vercel but the live site still uses the old value.
  5. If the code is livemode_mismatch or the message is "No such price", the key and the object are in different modes. See Stripe error: No such price / No such customer (resource_missing).

How to check it worked

  • The same API call returns the object instead of api_key_expired.
  • Stripe's error-code page says to use Workbench to review the request. The expired-key code is gone.

Sources

More Stripe fixes

Keep going on your own.

The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.

See products