Symptom
Your server calls a Kyren Pay API endpoint and receives401 Unauthorized.
Likely causes
- The
x-api-keyheader is missing or empty. - The API key is invalid, expired, or was rotated.
- The request uses a key from the wrong environment.
- IP allowlisting is enabled and the request comes from an unlisted server IP.
- The key was exposed and should no longer be trusted.
Check this in Kyren
- Open Dashboard > Developer settings and confirm the active API key.
- If IP allowlisting is enabled, confirm your outbound server IP is listed.
- If the key may have been exposed, rotate it and update your server configuration.
Check this in your server
- Confirm the request sends
x-api-keyexactly as an HTTP header. - Check that secrets were loaded into the running process after deployment.
- Verify the request is going to the intended Kyren Pay API base URL.
- Search recent deploys for key rotation, secret name, or configuration changes.
Fix
- Add or correct the
x-api-keyheader. - Replace stale keys with the current key from Developer settings.
- Update the IP allowlist when your hosting provider changes outbound IPs.
- Rotate any key that was committed, logged, or shared outside trusted systems.