Create hook-led videos programmatically
One endpoint, ten workflows. Pick what you start from — a script, a prompt, a link, or a file — and the API handles visuals, voice-over, captions, music, and viral hook pairing. Every render call costs 10 credits plus generation costs. Estimate any payload for free before running it.
What are you starting from?
The workflow field decides everything else — required input, defaults, and which parameters apply.
A script — the exact words to be spoken
An idea or topic — the AI writes the script
A link — article, music, or any web page
A file — audio or video to transform
Selected: Script to video
{
"workflow": "script-to-video",
"source": {
"text": "Did you know honey never spoils? Archaeologists found edible honey in Egyptian tombs."
},
"hook": {
"slug": "flip-on-head"
},
"webhookUrl": "https://your-server.com/viralhooks/webhook"
}Render request
curl -X POST 'https://api.viralhooks.org/v1/render' \
-H 'Content-Type: application/json' \
-H 'key: YOUR_API_KEY' \
-d '{"workflow":"script-to-video","source":{"text":"Did you know honey never spoils? Archaeologists found edible honey in Egyptian tombs."},"hook":{"slug":"flip-on-head"},"webhookUrl":"https://your-server.com/viralhooks/webhook"}'Your first video in 3 steps
Get a key
Grab your API key from account settings after sign-in. Send it in the key header on every call.
Start a render
POST to /render with your workflow, source payload, and optional webhookUrl.
Get the result
Renders are async — your webhook fires when ready, or poll /status with the pid you received.
curl -X POST 'https://api.viralhooks.org/v1/render' \
-H 'Content-Type: application/json' \
-H 'key: YOUR_API_KEY' \
-d '{
"workflow": "script-to-video",
"source": { "text": "Did you know honey never spoils?" },
"hook": { "slug": "flip-on-head" },
"webhookUrl": "https://your-server.com/viralhooks/webhook"
}'curl 'https://api.viralhooks.org/v1/status?pid=YOUR_PID' \
-H 'key: YOUR_API_KEY'Pro tip: Configure a video in the dashboard generator, click Get API code, and reuse that exact payload in your integration.
All workflows at a glance
What each workflow needs (●) and what you can customize (✓). Click a row to explore its parameters above.
| Workflow | Requires | source | media | voice | captions | music | avatar | hook | options | render |
|---|---|---|---|---|---|---|---|---|---|---|
| Script to video | source.text | ● | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Avatar to video | source.text + avatar.url | ● | ✓ | ✓ | ✓ | ✓ | ● | ✓ | ✓ | ✓ |
| Static background video | source.text or source.url | ● | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Prompt to video | source.prompt | ● | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Ad generator | source.prompt or media.provided[] | ● | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Article to video | source.url | ● | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Music to video | source.url | ● | ✓ | — | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Audio to video | source.url | ● | ✓ | — | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Caption video | source.url | ● | ✓ | — | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| Motion transfer | source.url + media.provided[] (1 image) | ● | ● | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
Free cost estimate
POST /estimate with the same body as /render — returns credit cost without charging.
curl -X POST 'https://api.viralhooks.org/v1/estimate' \
-H 'Content-Type: application/json' \
-H 'key: YOUR_API_KEY' \
-d '{
"workflow": "prompt-to-video",
"source": { "prompt": "Street interview reaction, 9:16" },
"options": { "durationSec": 10 }
}'More resources
Base URL: https://api.viralhooks.org/v1