Give the video a voice
and a soundtrack, from one key
One call speaks a line of your timeline and comes back word-aligned by Whisper, so subtitles land on the syllable. Another writes the song under it. Four voice providers, one endpoint each.
POSThttps://autostud.ai/api/v1/actions/timeline.generate_audioThree calls, silence to soundtrack
Voice the block, add a song if you want one, then render the whole thing.
- 1
Voice a block
Point the call at a block of the timeline and the voice you want. What comes back is the audio, its exact duration, and the Whisper word timings that make subtitles land on the syllable.
export AUTOSTUD_API_KEY="sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" curl -X POST https://autostud.ai/api/v1/actions/timeline.generate_audio \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "video_id": "0f4c8b71-2d95-47a3-9e6c-15b8ad7f3c20", "block_id": "block_2", "voice_settings": { "voice_provider": "elevenlabs", "voice_id": "rachel", "playback_speed": 1 } }' - 2
Write the song
A brief, a style or your own lyrics. Songs are asynchronous: the call returns a task and music.completed brings the hosted tracks back.
curl -X POST https://autostud.ai/api/v1/actions/music.generate \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Lighthouse", "style": "warm lo-fi, slow, no drums", "prompt": "A calm bed under a voice-over about the sea", "instrumental": true }' # Already wrote the words? Send lyrics instead of prompt. - 3
Render it together
Audio decides the length of a block, so once the voice is in, renders.create turns the timeline into an mp4 with everything in sync.
curl -X POST https://autostud.ai/api/v1/webhooks \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.com/hooks/autostud", "events": ["music.completed", "music.failed"], "description": "Audio" }'
What you can pass
Three fields to speak a block, one to brief a song.
video_idThe video whose timeline holds the block you are voicing.
block_idWhich block gets the voice. Its duration follows the audio, not the other way round.
voice_settingsThe voice itself: provider, voice reference, speed. Your own provider key means the generation costs nothing.
promptFor music.generate: the brief for the song. Pass lyrics instead when you already wrote them.
Four providers, one shape of call
Voices are a catalog, not a hardcoded list. Bring your own provider key and generations are free; use ours and they are billed in credits like everything else.
Songs report themselves
Speech comes back in the response. A song takes longer, so it fires an event instead: register a webhook once and the tracks arrive hosted, with the credits already reconciled.
generation.completedmusic.completedmusic.failedQuestions developers ask first
Do I get word-level timings?
Yes. Whisper alignment runs on what was just generated, so the response carries per-word timings at full precision, never rounded to the nearest second.
Can I use my own ElevenLabs key?
Yes, and it is the point of the dual mode: with your key the generation costs zero credits and the audio is still hosted, aligned and dropped onto the block for you.
How long does a song take?
Minutes, not milliseconds, which is why music is asynchronous. Read it back with music.get_task if a webhook is not an option in your stack.
What happens to the block duration?
The audio decides it. A block is as long as the speech inside it plus the gaps you configured, so nothing has to be timed by hand after the fact.
What you can call
Word-by-word subtitles with Whisper timings, AI emphasis and 116 styles.
Read the guideQueue a render, take the webhook instead of polling, download the mp4.
Read the guideText to video, faceless scenes and clip extension, straight from your backend.
Read the guideGenerate, restyle, crop and cut out backgrounds at scale.
Read the guideSchedule a finished video and read the calendar back.
Read the guideReady to create?
Start generating viral videos in minutes. No credit card required for the free trial.