This API example shows how to add an AI voice-over to a video using a single HTTP request. It uses Creatomate along with ElevenLabs' text-to-speech API. You only need to specify a template and the voiceover text:
curl -s -X POST https://api.creatomate.com/v1/renders \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-binary @- << EOF
{
"template_id": "58c1163e-f250-49df-b98d-e8c4aad01a2d",
"modifications": {
"Voiceover-1": "The 3 Best Tips for Healthy Eating",
"Voiceover-2": "Prioritize Whole Foods: Opt for fruits, vegetables, whole grains, lean proteins and healthy fats. They're packed with nutrients and fiber for overall health.",
"Voiceover-3": "Stay Hydrated: Drink plenty of water to support digestion, regulate temperature, and maintain health. Limit sugary drinks and make water your go-to beverage.",
"Voiceover-4": "Plan Meals: Prep your meals and snacks ahead of time to avoid impulsive, unhealthy food choices. Keep nutritious foods on hand to stay on track with your health goals."
}
}
EOF
How it works: Creatomate is a developer-focused cloud API for generating videos. The platform integrates seamlessly with ElevenLabs, OpenAI, and Stability AI. Its online editor allows you to create your own voice-over templates, which can then be used to automate the process of generating voice-overs.
A good place to begin is this step-by-step tutorial, which explains how to set up the voice-over shown above. Because of the platform's flexibility, you can create anything from engaging social media videos to professional voice-overs for online courses.
Creatomate's API lets you hook up all the major AI tools together, like ChatGPT to write the script, and DALL·E to use AI-generated images. It is also capable of generating subtitles that match your voiceover perfectly; all of this is done automatically.
Generating voiceover videos is one of the many video editing features supported by Creatomate. To learn more, sign up for a free account and try it out for yourself.