Overview

The Bluma API uses API keys for authentication. All requests must include a valid API key in the Authorization 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

  1. Log in to your Bluma dashboard
  2. Navigate to API Keys
  3. Click Create API Key
  4. Choose a name and environment (test or production)
  5. Set rate limits based on your tier
  6. Save the key securely (shown only once!)

Via API

You can also create API keys programmatically (requires an existing key):

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:
This creates a new key and schedules the old one for expiration in 30 days, giving you time to update your applications.

Revoking Keys

Immediately revoke a compromised key:
Revoking a key immediately stops all requests using that key. Make sure you have a replacement key ready.

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:
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: Rate limit headers are included in every response:
See Rate Limits for more details.

Error Handling

401 Unauthorized

Cause: Missing or invalid API key
Solution: Check that your API key is correct and properly formatted in the Authorization header.

403 Forbidden

Cause: API key lacks required permissions
Solution: Use an API key with the required scopes or create a new key with appropriate permissions.

Testing Authentication

Verify your API key is working:
A successful response confirms your key is valid:

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