All API requests to VIUCraft must be authenticated using an API key.
API Key Header
Include your API key in the X-API-Key header:
cURL
curl -H "X-API-Key: your-api-key" \
https://api.viucraft.com/images
Obtaining an API Key
- Log in to your VIUCraft dashboard
- Navigate to Dashboard > API Keys
- Click Generate New API Key
- Give your key a descriptive name
- Copy the key immediately (it will not be shown again)
API Key Best Practices
Use Environment Variables
Never hardcode API keys in your source code:
cURL
# .env file
VIUCRAFT_API_KEY=your-api-key
JavaScript
// Node.js
const apiKey = process.env.VIUCRAFT_API_KEY;
Separate Keys for Environments
Create different keys for:
- Development
- Staging
- Production
Key Rotation
Rotate your API keys periodically:
- Generate a new key
- Update your applications
- Revoke the old key
Authentication Errors
| Status Code | Error | Description |
|---|---|---|
| 401 | Missing API Key | No X-API-Key header provided |
| 401 | Invalid API Key | The API key is not valid |
| 403 | Revoked API Key | The API key has been revoked |
| 429 | Rate Limited | Too many requests |
Rate Limiting
Rate limits depend on your plan:
| Plan | Requests/minute | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Basic | 300 | 50,000 |
| Professional | 1,000 | 500,000 |
| Enterprise | Unlimited | Unlimited |