API Keys & Security
Protecting Your API Key
- Never expose in client-side code - Keep keys on your backend server
- Use environment variables - Store keys in .env files, never in source code
- Rotate regularly - Request new keys periodically from Spacio
- Use separate keys - Maintain different keys for dev, staging, and production
- Monitor usage - Track API usage to detect unauthorized access
Implementation Example
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('SPACIO_API_KEY')
# Use api_key in headers
headers = {'apikey': api_key}
IP Whitelisting
Contact support to enable IP whitelisting for additional security.
Rate Limiting
Your account has a 12,000 request/hour limit by default. Implement exponential backoff for retry logic.
Error Handling
Always check for 401 (Unauthorized) responses indicating compromised keys.