Overview
The Bluma API uses API keys for authentication. All requests must include a valid API key in theAuthorization header using the Bearer authentication scheme.
API Key Format
Bluma API keys follow this format:- Test keys:
bluma_test_xxxxxxxxxxxx - Production keys:
bluma_live_xxxxxxxxxxxx
Test keys generate watermarked videos and don’t consume credits. Production keys generate full-quality videos and charge credits.
Authentication Header
Include your API key in every request:Example Request
Creating API Keys
Via Dashboard
- Log in to your Bluma dashboard
- Navigate to API Keys
- Click Create API Key
- Choose a name and environment (test or production)
- Set rate limits based on your tier
- Save the key securely (shown only once!)
Via API
You can also create API keys programmatically (requires an existing key):View Response
View Response
Managing API Keys
Listing Your Keys
View all your API keys (without exposing the full key):Rotating Keys
For zero-downtime key rotation, use the rotate endpoint:Revoking Keys
Immediately revoke a compromised key:Security Best Practices
Use Environment Variables
Never hardcode API keys in your source code. Use environment variables:
Restrict by Environment
Use test keys for development and staging. Only use production keys in production.
Rotate Regularly
Rotate your API keys every 90 days for enhanced security.
Monitor Usage
Regularly check your usage dashboard for unusual activity.
API Scopes
API keys have the following scopes by default:| Scope | Description |
|---|---|
videos:create | Generate new videos |
videos:read | View video status and details |
videos:download | Download generated videos |
templates:list | Browse available templates |
templates:read | View template details |
credits:read | Check credit balance and history |
webhooks:manage | Create and manage webhooks |
usage:read | View usage analytics |
Custom scopes are available for Enterprise plans. Contact support@getbluma.com for more information.
Rate Limits
Each API key has a rate limit based on your subscription tier:| Tier | Requests/Hour | Videos/Month |
|---|---|---|
| Free | 100 | 10 |
| Starter | 1,000 | 100 |
| Pro | 5,000 | 500 |
| Enterprise | 50,000 | 3,000 |
Error Handling
401 Unauthorized
Cause: Missing or invalid API key403 Forbidden
Cause: API key lacks required permissionsTesting Authentication
Verify your API key is working:Next Steps
Generate Your First Video
Start creating videos with your API key
Set Up Webhooks
Configure webhook notifications
Monitor Usage
Track API usage and performance
Error Handling
Learn how to handle API errors