Skip to main content

API Keys

All TinyFn API requests require authentication via an API key. Include your key in the X-API-Key header:
curl "https://api.tinyfn.io/v1/generate/uuid" \
  -H "X-API-Key: tfn_live_abc123..."

Getting your API key

  1. Sign up for a free account
  2. Your API key will be displayed on the dashboard
  3. Copy and store it securely - it won’t be shown again
Never expose your API key in client-side code, public repositories, or anywhere it could be seen by others.

Key format

TinyFn API keys follow this format:
PrefixEnvironmentExample
tfn_live_Productiontfn_live_abc123def456...
tfn_test_Testingtfn_test_xyz789...

Security best practices

Store your API key in environment variables, not in code:
export TINYFN_API_KEY="tfn_live_abc123..."
import os
api_key = os.environ.get('TINYFN_API_KEY')
You can generate new API keys from your dashboard. Rotate keys periodically and if you suspect a key has been compromised.
Use different API keys for development, staging, and production environments.

Error responses

If authentication fails, you’ll receive a 401 Unauthorized response:
{
  "error": "Invalid API key",
  "code": "UNAUTHORIZED"
}
Common causes:
  • Missing X-API-Key header
  • Invalid or expired API key
  • Key doesn’t have permission for the requested endpoint