API Keys
All TinyFn API requests require authentication via an API key. Include your key in theX-API-Key header:
Getting your API key
- Sign up for a free account
- Your API key will be displayed on the dashboard
- Copy and store it securely - it won’t be shown again
Key format
TinyFn API keys follow this format:| Prefix | Environment | Example |
|---|---|---|
tfn_live_ | Production | tfn_live_abc123def456... |
tfn_test_ | Testing | tfn_test_xyz789... |
Security best practices
Use environment variables
Use environment variables
Store your API key in environment variables, not in code:
Rotate keys regularly
Rotate keys regularly
You can generate new API keys from your dashboard. Rotate keys periodically and if you suspect a key has been compromised.
Use separate keys per environment
Use separate keys per environment
Use different API keys for development, staging, and production environments.
Error responses
If authentication fails, you’ll receive a401 Unauthorized response:
- Missing
X-API-Keyheader - Invalid or expired API key
- Key doesn’t have permission for the requested endpoint