> For the complete documentation index, see [llms.txt](https://apidocs.lwolf.com/doc/spacio-api/llms.txt)

# API Keys & Security Best Practices

## API Keys & Security

### Protecting Your API Key
1. **Never expose in client-side code** - Keep keys on your backend server
2. **Use environment variables** - Store keys in .env files, never in source code
3. **Rotate regularly** - Request new keys periodically from Spacio
4. **Use separate keys** - Maintain different keys for dev, staging, and production
5. **Monitor usage** - Track API usage to detect unauthorized access

### Implementation Example
```python
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.

