curl -X POST "https://api.hooked.so/v1/project/create/script-to-video" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": { "preset": "cinematic" },
"aspectRatio": "ratio_9_16",
"caption": { "preset": "tiktok" },
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": { "postId": "1234" }
}'
const response = await fetch("https://api.hooked.so/v1/project/create/script-to-video", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
script: "Most people drink coffee wrong. Here are three things baristas never do at home.",
voiceId: "1004",
mediaType: "ai-images",
presetSettings: { preset: "cinematic" },
aspectRatio: "ratio_9_16",
caption: { preset: "tiktok" },
webhook: "https://example.com/hooked/webhook?token=YOUR_SECRET",
metadata: { postId: "1234" },
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/script-to-video",
headers={"x-api-key": "your_api_key_here"},
json={
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": {"preset": "cinematic"},
"aspectRatio": "ratio_9_16",
"caption": {"preset": "tiktok"},
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": {"postId": "1234"},
},
)
print(response.json()["data"]["projectId"])
{
"success": true,
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"status": "processing"
},
"message": "Script to Video successfully created"
}
{
"success": false,
"message": "voiceId: Voice \"9999\" not found."
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"code": "missing_credentials",
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: OpenRouter, ElevenLabs. Add them in Settings → AI keys.",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["openrouter", "elevenlabs"],
"details": {}
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for Script to Video. Needed: 120, Available: 45",
"creditsNeeded": 120,
"creditsAvailable": 45
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
Script to Video
Turn a script into a narrated video with AI images, AI video clips, motion graphics, gameplay or your own media
curl -X POST "https://api.hooked.so/v1/project/create/script-to-video" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": { "preset": "cinematic" },
"aspectRatio": "ratio_9_16",
"caption": { "preset": "tiktok" },
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": { "postId": "1234" }
}'
const response = await fetch("https://api.hooked.so/v1/project/create/script-to-video", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
script: "Most people drink coffee wrong. Here are three things baristas never do at home.",
voiceId: "1004",
mediaType: "ai-images",
presetSettings: { preset: "cinematic" },
aspectRatio: "ratio_9_16",
caption: { preset: "tiktok" },
webhook: "https://example.com/hooked/webhook?token=YOUR_SECRET",
metadata: { postId: "1234" },
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/script-to-video",
headers={"x-api-key": "your_api_key_here"},
json={
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": {"preset": "cinematic"},
"aspectRatio": "ratio_9_16",
"caption": {"preset": "tiktok"},
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": {"postId": "1234"},
},
)
print(response.json()["data"]["projectId"])
{
"success": true,
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"status": "processing"
},
"message": "Script to Video successfully created"
}
{
"success": false,
"message": "voiceId: Voice \"9999\" not found."
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"code": "missing_credentials",
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: OpenRouter, ElevenLabs. Add them in Settings → AI keys.",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["openrouter", "elevenlabs"],
"details": {}
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for Script to Video. Needed: 120, Available: 45",
"creditsNeeded": 120,
"creditsAvailable": 45
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
Overview
Script to Video reads your script with a voice, splits it into scenes and puts a visual under each one. You choose where the visuals come from withmediaType:
mediaType | Visuals | Settings it reads |
|---|---|---|
ai-images | One AI image per scene | presetSettings: preset, aiModel, characterIds, useCharacterReferenceImage |
ai-videos | One AI video clip per scene | presetSettings: preset, quality, aiModel, isContinuous, characterIds, characterMode, voiceProfile |
motion-graphics | An animated motion graphic that typesets its own copy (no captions or stickers) | presetSettings: quality, motionStyleId, motionGuidelines; media as optional footage |
media | Your own images and videos from the media library | media (required) |
gameplay | A gameplay clip in the background (Minecraft, Subway Surfers style, etc.) | gameplaySettings |
aspectRatio, language, musicId, audio, content.brandingLogo, webhook and metadata; all but motion-graphics take caption and addStickers. The field list on this page says which media types read each field.
Talking characters. With mediaType: "ai-videos", one of the talking-fruit, talking-objects or talking-organs presets and presetSettings.characterMode: "speaking", the characters say the lines themselves with the video model’s own audio. There is no narrator, captions or stickers, so audio, caption and addStickers do not apply (voiceId is still required). speaking with any other media type or preset answers 400.
The request returns a projectId right away. The video is generated and rendered in the background.
POST https://api.hooked.so/v1/project/create/script-to-video
curl -X POST "https://api.hooked.so/v1/project/create/script-to-video" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": { "preset": "cinematic" },
"aspectRatio": "ratio_9_16",
"caption": { "preset": "tiktok" },
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": { "postId": "1234" }
}'
const response = await fetch("https://api.hooked.so/v1/project/create/script-to-video", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
script: "Most people drink coffee wrong. Here are three things baristas never do at home.",
voiceId: "1004",
mediaType: "ai-images",
presetSettings: { preset: "cinematic" },
aspectRatio: "ratio_9_16",
caption: { preset: "tiktok" },
webhook: "https://example.com/hooked/webhook?token=YOUR_SECRET",
metadata: { postId: "1234" },
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/script-to-video",
headers={"x-api-key": "your_api_key_here"},
json={
"script": "Most people drink coffee wrong. Here are three things baristas never do at home.",
"voiceId": "1004",
"mediaType": "ai-images",
"presetSettings": {"preset": "cinematic"},
"aspectRatio": "ratio_9_16",
"caption": {"preset": "tiktok"},
"webhook": "https://example.com/hooked/webhook?token=YOUR_SECRET",
"metadata": {"postId": "1234"},
},
)
print(response.json()["data"]["projectId"])
More request bodies
{
"script": "In 1969, three astronauts left Earth with less computing power than a calculator.",
"voiceId": "1004",
"mediaType": "ai-videos",
"presetSettings": {
"preset": "realistic",
"aiModel": "seedance_2_0_fast",
"isContinuous": true
}
}
{
"script": "Our new collection is here. Lightweight, waterproof and made to last.",
"voiceId": "1004",
"mediaType": "media",
"media": ["cm4x9k2p10001ab12cd34ef56", "cm4x9k2p10002ab12cd34ef56"],
"aspectRatio": "ratio_1_1"
}
{
"script": "Here is a fact that will change how you think about sleep.",
"voiceId": "1004",
"mediaType": "gameplay",
"gameplaySettings": { "selectedGame": "subway-s", "selectedVideo": "subway-s-3" }
}
{
"script": "Three numbers that explain our year: 2 million users, 40 countries, one team.",
"voiceId": "1004",
"mediaType": "motion-graphics",
"presetSettings": {
"motionStyleId": "modern-saas",
"motionGuidelines": "Brand colors purple and white, big numbers, fast cuts"
}
}
{
"success": true,
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"status": "processing"
},
"message": "Script to Video successfully created"
}
{
"success": false,
"message": "voiceId: Voice \"9999\" not found."
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"code": "missing_credentials",
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: OpenRouter, ElevenLabs. Add them in Settings → AI keys.",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["openrouter", "elevenlabs"],
"details": {}
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for Script to Video. Needed: 120, Available: 45",
"creditsNeeded": 120,
"creditsAvailable": 45
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
What happens next
- Keep the
projectId. - Either poll
GET /v1/project/{projectId}untilvideo.statusisCOMPLETED(or the projectstatusisfailed), or pass awebhookand wait for the call. - Download the file from
video.url(ordata.urlin the webhook).
{
"status": "COMPLETED",
"message": "Video completed",
"data": {
"videoId": "cm4xa1b2c0003ab12cd34ef56",
"projectId": "cm4x9k2p10001ab12cd34ef56",
"status": "COMPLETED",
"url": "https://...",
"metadata": { "postId": "1234" }
}
}
"status": "FAILED" with videoId: null. See Webhooks for every payload.
Credits and your own keys
Teams on Hooked’s keys (managed): the project is priced from the script, the media type, the quality or model and the character mode, and the credits are taken up front. WithmediaType: "media" your library files are used as they are and cost nothing on top of the narration, however many you send (the same as a gameplay background). If the balance is short, the request answers 402 INSUFFICIENT_CREDITS with creditsNeeded and creditsAvailable and nothing is created. If the project fails later, the credits are refunded automatically.
Teams on their own keys (BYOK): no credits are charged. The team needs these keys in Settings → AI keys:
- OpenRouter: always (script, images, video clips, captions).
- ElevenLabs: for the voiceover. Not needed in
speakingmode (ai-videoswith a talking preset), where the video model speaks. - Gemini: when
presetSettings.aiModelisgemini_omni_flash.
402 missing_credentials with the list in missingProviders, before anything is created.
Errors
| Status | Body | When |
|---|---|---|
400 | { "success": false, "message": "<field>: <reason>" } | Validation failed. Examples: Media type is required, script: Required (missing) or script: Script is required (empty), voiceId: Voice "…" not found., musicId: Music "…" not found., media: Media "…" not found, media: Media is required for media type: media (no media, or an empty array, with mediaType: "media"), presetSettings.preset: Invalid preset "…". Allowed values are: … (or Custom style "custom-…" not found for a custom style that is not your team’s), presetSettings.motionStyleId: Invalid motion style "…". Allowed values are: …, caption.preset: Invalid caption preset "…". Allowed values are: …, gameplaySettings.selectedGame: Invalid game "…". Allowed values are: …, presetSettings.aiModel: "…" does not generate ai-images, presetSettings.characterMode: "speaking" needs mediaType ai-videos, …, gameplaySettings.selectedVideo: Video "…" not found in your library, webhook: Must be a valid HTTPS URL, Invalid JSON body, or the script was rejected by the content filter. Settings checked by type or range report their stored path: a bad presetSettings.quality answers projectSettings.preset.quality: …, a bad aspectRatio, caption or audio value answers videoSettings.aspectRatio: …, videoSettings.caption.… or videoSettings.audio.…. |
401 | not_authenticated | Missing or invalid x-api-key. |
402 | missing_credentials | BYOK team without the keys listed above. |
402 | subscription_required | Managed team without an active plan. |
402 | INSUFFICIENT_CREDITS | Managed team without enough credits. |
403 | entitlement_required | The team does not have the product this endpoint needs. |
500 | { "success": false, "message": "..." } | Unexpected error; credits taken for this request are refunded. |
Idempotency-Key header to retry safely: if a request times out or answers 5xx, sending it again with the same key and body returns the first answer instead of creating (and charging) the project twice.Next Steps
Get Project
Webhooks
List Voices
Prompt to Video
Headers
Makes the request safe to retry. 1-255 printable ASCII characters, one per operation (your job id, or a UUID you store), reused on every retry. Within 24 hours the same key with the same body answers with the first response and the header Idempotent-Replayed: true, without running or charging again. Keys are scoped to your team and the endpoint. 5xx answers and refusals before anything ran (401, 402, 403, 409, 429) are not kept. See Idempotency.
1 - 255^[\x20-\x7E]+$Query Parameters
true: only answer the price of this exact request, as { success: true, data: { dryRun: true, estimatedCredits } } with status 200. The request is validated like a real one (a 400 or 402 says the same), but nothing is created, queued or charged. estimatedCredits is exactly what the call without dryRun charges a managed team; a byok team is charged nothing. Do not send an Idempotency-Key with it.
Body
The narrator: a library voice from /v1/voice/list or one of your team's custom voices. An ID that is neither answers 400 (voiceId: Voice "<id>" not found.). Still required with characterMode: "speaking", where the characters speak with the video model's own voice and this voice is not used.
1 - 30Where the visuals come from:
ai-images: one AI image per scene (presetSettings:preset,aiModel,characterIds,useCharacterReferenceImage).ai-videos: one AI video clip per scene (presetSettings:preset,quality,aiModel,isContinuous,characterIds,characterMode,voiceProfile).motion-graphics: an animated motion graphic that typesets its own copy (presetSettings:quality,motionStyleId,motionGuidelines;mediaoptional as footage). No captions or stickers.media: your own images and videos from the media library (mediarequired). NopresetSettings.gameplay: a gameplay clip in the background (gameplaySettings). NopresetSettings.
ai-images, ai-videos, motion-graphics, media, gameplay IDs of images or videos in your team's media library (max 50). Required for mediaType: "media" (send at least one); optional footage for motion-graphics; ignored for the other media types. An ID that is not in your library answers 400 (media: Media "<id>" not found). A media that is not COMPLETED yet (an import or upload in progress) answers 400 media: Media "<id>" is not ready (status PROCESSING).
50Media ID from your library
HTTPS URL on a public host, called when the video is ready or the project fails (max 500 characters). Requests are signed: verify the Hooked-Signature header (HMAC-SHA256 of ".") with the signing secret from Settings → Webhooks; Hooked-Event and Hooked-Delivery headers name the event and the delivery. No redirects are followed; 10 s timeout; 3 immediate attempts. See the Webhooks guide for the payload.
500