Generate API Keys
Locate API Keys
- Log into dashboard.stendly.com
- Navigate to API Keys in the sidebar
- Click Generate New Key
Key Format
All API keys use the st_live_ prefix. Select the target environment when initializing the SDK:
| Prefix | Environment | Usage |
|---|---|---|
st_live_ | mainnet | Production payments |
st_live_ | devnet | Development/testing |
Security Best Practices
- Never commit API keys to version control
- Use environment variables or a secret manager
- Rotate keys regularly (every 90 days recommended)
- Use separate keys for development and production
- Revoke compromised keys immediately from the dashboard
Good
import os
client = Client(api_key=os.environ["STENDLY_API_KEY"])
Bad
client = Client(api_key="st_live_xxxxxxxxx") # ❌ Never hardcode