Keys / Razorpay

RAZORPAY_KEY_SECRET

The key secret your server pairs with the key ID (RAZORPAY_KEY_ID) to call Razorpay's APIs with Basic Auth. Test and Live mode each have their own.

Expires
the docs don't say
API
none; Dashboard only

Get it

Create one on dashboard.razorpay.com. The steps aren't recorded yet.

Set it

RAZORPAY_KEY_SECRET=...

Razorpay's Node.js, Python, Go, PHP, Ruby and Java SDKs don't read it; your app passes it in with the key ID. The Razorpay CLI and MCP server read RAZORPAY_KEY_SECRET. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. In the Dashboard, pick Test or Live mode, then go to Account & Settings > API Keys > Generate new key. Choose to deactivate the old key within 24 hours, not immediately.
  2. Download the new key ID and secret. The Dashboard shows only the key ID afterward.
  3. Deploy both everywhere that reads RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET before the 24 hours end. Check that nothing still uses the old key; it stops working then.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16