Prerequisites

Before starting, make sure you have:
  • ✅ A Bluma account (sign up)
  • ✅ An API key (get one here)
  • ✅ Basic knowledge of making HTTP requests
Use a test API key for this tutorial - it’s free and generates watermarked videos perfect for learning!

Step 1: Choose a Template

First, let’s see what templates are available:
You’ll see a list of templates. For this tutorial, we’ll use consumerclub-discord-zoomed.

Step 2: Create the Video

Let’s generate a fun personality quiz video:
Response:
Save the id - you’ll need it to check the status and download your video!

Step 3: Check the Status

Video generation is asynchronous (takes 2-5 minutes). Poll the status endpoint:
Status progression:
  • queuedprocessingcompleted
Don’t poll too frequently! Check every 5-10 seconds to avoid rate limits. Better yet, use webhooks for production.

Step 4: Download Your Video

Once status is completed, get the download URL:
Response:
Download URLs expire in 1 hour. Download your video before expiration!

Complete Example

Here’s the full workflow in one script:

Troubleshooting

Problem: Invalid or missing API keySolution:
  • Verify your API key is correct
  • Check it’s in the Authorization header: Bearer YOUR_KEY
  • Ensure it starts with bluma_live_ or bluma_test_
Problem: Not enough credits for video generationSolution:
  • Check balance: GET /v1/credits/balance
  • Use a test key (free, unlimited)
  • Purchase more credits or upgrade plan
Problem: Video taking longer than expectedSolution:
  • Complex templates can take 5-10 minutes
  • Check status hasn’t changed to ‘failed’
  • Set up webhooks instead of polling
Problem: Waited too long to downloadSolution:
  • Request a new download URL (doesn’t cost credits)
  • Download immediately after getting URL
  • Store videos in your own storage if needed long-term

Next Steps

Set Up Webhooks

Stop polling - get notified when videos are ready

Explore Templates

Try different video styles and templates

Production Setup

Switch from test to production mode

Best Practices

Build robust production integrations

Congratulations! 🎉

You’ve successfully generated your first AI video with the Bluma API. The same pattern applies to all templates - just change the template_id and customize the context.