curl --request POST \ --url https://tavusapi.com/v2/videos \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "background_url": "https://yourwebsite.com/", "replica_id": "rc9cff32ceba", "script": "Hi, this is my first video.", "video_name": "My First Video"}'
import requests
url = "https://tavusapi.com/v2/videos"
payload = {
"background_url": "https://yourwebsite.com/",
"replica_id": "rc9cff32ceba",
"script": "Hi, this is my first video.",
"video_name": "My First Video"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
background_url: 'https://yourwebsite.com/',
replica_id: 'rc9cff32ceba',
script: 'Hi, this is my first video.',
video_name: 'My First Video'
})
};
fetch('https://tavusapi.com/v2/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tavusapi.com/v2/videos"
payload := strings.NewReader("{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://tavusapi.com/v2/videos")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}"
response = http.request(request)
puts response.read_body
This endpoint generates a new video using a face and either a script or an audio file.
POST
/
v2
/
videos
Generate Video
curl --request POST \ --url https://tavusapi.com/v2/videos \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "background_url": "https://yourwebsite.com/", "replica_id": "rc9cff32ceba", "script": "Hi, this is my first video.", "video_name": "My First Video"}'
import requests
url = "https://tavusapi.com/v2/videos"
payload = {
"background_url": "https://yourwebsite.com/",
"replica_id": "rc9cff32ceba",
"script": "Hi, this is my first video.",
"video_name": "My First Video"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
background_url: 'https://yourwebsite.com/',
replica_id: 'rc9cff32ceba',
script: 'Hi, this is my first video.',
video_name: 'My First Video'
})
};
fetch('https://tavusapi.com/v2/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tavusapi.com/v2/videos"
payload := strings.NewReader("{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://tavusapi.com/v2/videos")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://tavusapi.com/v2/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"background_url\": \"https://yourwebsite.com/\",\n \"replica_id\": \"rc9cff32ceba\",\n \"script\": \"Hi, this is my first video.\",\n \"video_name\": \"My First Video\"\n}"
response = http.request(request)
puts response.read_body
The only required body parameters are replica_id and either script or audio_url. (replica_id is the face resource ID - the same value returned by GET /v2/faces.)
If a background_url is provided, Tavus records the website and uses it as the background. If a background_source_url is provided (for example a presigned S3 URL to a video), that video is used as the background. If neither is provided, the video is full-screen face only.
To learn more about generating videos with faces, see here.
To learn more about writing an effective script for your video, see Scripting prompting.
A direct link to a video that is publicly accessible via a storage location such as an S3 bucket. This will be used as the background for the video. The video must be publicly accessible.
If set to true, the video will be generated using a barebones fast rendering process. This will result in a faster generation of the video but some features will be disabled. Features such as background generation, thumbnail images, and streaming urls are not supported when using this fast rendering process.
A direct link to a image that is publicly accessible via a storage location such as an S3 bucket. This will be used as the watermark on the video. Currently, it support png & jpeg formats only. Ensure the image is publicly accessible.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tavus","colors":{"primary":"#FA3862","light":"#FA3862","dark":"#FA3862"},"logo":{"light":"https://mintcdn.com/tavus/mlBBb4gkXXhWTLQi/logo/light_logo.png?fit=max\u0026auto=format\u0026n=mlBBb4gkXXhWTLQi\u0026q=85\u0026s=892e020f9d0afc49e64011dcae9d3dd6","dark":"https://mintcdn.com/tavus/mlBBb4gkXXhWTLQi/logo/dark_logo.png?fit=max\u0026auto=format\u0026n=mlBBb4gkXXhWTLQi\u0026q=85\u0026s=1268f09533ab55791e8ef8200d4a669f"},"favicon":{"light":"https://mintcdn.com/tavus/yC-TYEqHye998xbI/favicon_light.png?fit=max\u0026auto=format\u0026n=yC-TYEqHye998xbI\u0026q=85\u0026s=25642e844d8f4aaad82e6cb0d0cf44c3","dark":"https://mintcdn.com/tavus/yC-TYEqHye998xbI/favicon_dark.png?fit=max\u0026auto=format\u0026n=yC-TYEqHye998xbI\u0026q=85\u0026s=42861da3c81323c222cd6182eee43175"},"api":{"openapi":"openapi.yaml"},"navbar":{"links":[{"href":"https://discord.gg/5Y9Er6WNN5","label":"Community"},{"href":"https://status.tavus.io","label":"Status"},{"href":"mailto:support@tavus.io","label":"Get Support"}],"primary":{"type":"button","label":"Get Started","href":"https://maker.tavus.io/auth/sign-up?is_developer=true"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/tavus-io","discord":"https://discord.gg/5Y9Er6WNN5"}},"integrations":{"ga4":{"measurementId":"G-SBQHZWT4FS"}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","mcp"],"display":"header"},"interaction":{"drilldown":false},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tavus","hasAudioNarration":false,"actualSubdomain":"tavus","customDomains":["docs.tavus.io"],"gitSource":{"type":"github","owner":"tavus-engineering","repo":"platform-api-developer-documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aea206a90fba1e9dbe24b96","collectionId":"2a6c22b1-36b2-4831-a174-9ea72eeec9d5","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aea206a90fba1e9dbe24b96"},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aea5d6fc31d8e457a440115","clientVersion":"0.0.4054","searchFilterCounts":[{"language":"default","tag":"CVI","count":137},{"language":"default","tag":"API","count":93},{"language":"default","tag":"Build","count":92},{"language":"default","tag":"Skills","count":27},{"language":"default","tag":"Deploy","count":23},{"language":"default","tag":"Interaction Events","count":21},{"language":"default","tag":"Face","count":20},{"language":"default","tag":"Magic Canvas","count":17},{"language":"default","tag":"Deployments","count":16},{"language":"default","tag":"Tools","count":14}]},"assistantConfig":{"enableStarterQuestions":true,"enableContextualStarterQuestions":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/video-request/create-video","slug":"/api-reference/video-request/create-video","pageMetadata":{"openapi":"post /v2/videos","keywords":["replica","replica_id","face","face_id"],"title":"Generate Video","description":"This endpoint generates a new video using a face and either a script or an audio file.\n","href":"/api-reference/video-request/create-video"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"This endpoint generates a new video using a face and either a script or an audio file.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,..._provideComponents(),...props.components},{Info}=_components;if(!Info)_missingMdxReference(`Info`,true);return _jsx(Info,{children:_jsxs(_components.p,{children:[`For AI agents, use `,_jsx(_components.code,{children:`https://docs.tavus.io/openapi.yaml`}),` for the full HTTP API contract.`]})})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /v2/videos","keywords":["replica","replica_id","face","face_id"],"title":"Generate Video","description":"This endpoint generates a new video using a face and either a script or an audio file.\n","href":"/api-reference/video-request/create-video"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Videos"],"summary":"Generate Video","description":"This endpoint generates a new video using a face and either a script or an audio file.\n","operationId":"generateVideo","requestBody":"2dcf9050-16b5-446a-b057-44aa0b052cac","responses":{"200":"9f7d2d48-78f2-4ae8-be04-fe1188926446","400":"022294ab-ce69-4e6a-ade1-b26c4538cc94","401":"d2ae466d-8745-44b4-8f33-8c98a16729ba"},"security":["2d36cd34-d350-481c-9008-1b5b3e90e82a"],"method":"post","type":"path","servers":["6012df5b-a62b-406c-b32a-b2804c3b92cf"],"path":"/v2/videos","baseUrlOptions":["https://tavusapi.com"],"title":"Generate Video","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"description":"The only required body parameters are `replica_id` and either `script` or `audio_url`. (`replica_id` is the face resource ID - the same value returned by `GET /v2/faces`.)\n\nIf a `background_url` is provided, Tavus records the website and uses it as the background. If a `background_source_url` is provided (for example a presigned S3 URL to a video), that video is used as the background. If neither is provided, the video is full-screen face only.\n\nTo learn more about generating videos with faces, see [here](/sections/video/quickstart).\n\nTo learn more about writing an effective script for your video, see [Scripting prompting](/sections/troubleshooting#script-length).\n","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Generate from Text","required":["replica_id","script"],"properties":{"script":{"type":"string","description":"A text script that will be used to generate the audio in the video.","example":"Hello from Tavus! Enjoy your new face","isRequired":true,"uniqueKey":"oneOf.0.script","typeLabel":"string"},"replica_id":{"type":"string","description":"The Face ID to render in the video (same resource as `face_id` on `/v2/faces`; this endpoint still accepts `replica_id`).","example":"rc9cff32ceba","isRequired":true,"uniqueKey":"oneOf.0.replica_id","typeLabel":"string"},"video_name":{"type":"string","description":"A name for the video.","example":"My First Video","uniqueKey":"oneOf.0.video_name","typeLabel":"string"},"background_url":{"type":"string","description":"A link to a website. This will be used as the background for the video. The website must be publicly accessible and properly formed.","example":"https://yourwebsite.com/","uniqueKey":"oneOf.0.background_url","typeLabel":"string"},"background_source_url":{"type":"string","description":"A direct link to a video that is publicly accessible via a storage location such as an S3 bucket. This will be used as the background for the video. The video must be publicly accessible.","example":"https://my-example-bucket.s3.us-east-1.amazonaws.com/your-background-video.mp4","uniqueKey":"oneOf.0.background_source_url","typeLabel":"string"},"callback_url":{"type":"string","description":"A url that will receive a callback on completion of video generation or on error.","example":"https://yourwebsite.com/webhook","uniqueKey":"oneOf.0.callback_url","typeLabel":"string"},"fast":{"type":"boolean","description":"If set to true, the video will be generated using a barebones fast rendering process. This will result in a faster generation of the video but some features will be disabled. Features such as background generation, thumbnail images, and streaming urls are not supported when using this fast rendering process.","example":false,"uniqueKey":"oneOf.0.fast","typeLabel":"boolean"},"transparent_background":{"type":"boolean","description":"If set to true, the generated video will be a `.webm` video with a transparent background.\n\nPlease note that this feature only works if the `fast` parameter is set to `true`.\n","example":false,"uniqueKey":"oneOf.0.transparent_background","typeLabel":"boolean"},"watermark_image_url":{"type":"string","description":"A direct link to a image that is publicly accessible via a storage location such as an S3 bucket. This will be used as the watermark on the video. Currently, it support `png` \u0026 `jpeg` formats only. Ensure the image is publicly accessible.","example":"https://s3.amazonaws.com/watermark.png","uniqueKey":"oneOf.0.watermark_image_url","typeLabel":"string"},"properties":{"type":"object","properties":{"background_scroll":{"type":"boolean","description":"If `background_url` is provided, this option may be configured.\n\nIf set to `true`, the background video will scroll down through the website. If set to `false`, the background video will display the top of the website. \n\nThe default is `true`.\n","example":true,"uniqueKey":"oneOf.0.properties.background_scroll","typeLabel":"boolean"},"background_scroll_type":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\nThis parameter defines the scroll pattern if `background_scroll` is set to `true`. \n\nThere are two options: `human`, `smooth`. \n\nThe `human` scroll type is the default type and mimics a human scrolling through the webpage, briefly stopping at certain intervals to give a natural appearance. The `smooth` scroll type scroll in a uniform manner all the way down the website without stopping.\n\nThe default is `human`.\n","uniqueKey":"oneOf.0.properties.background_scroll_type","typeLabel":"string"},"background_scroll_depth":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\n This parameter defines how far down the webpage the background video will scroll.\n \n There are two options: `middle`, `bottom`.\n \n The `middle` depth option will stop scrolling once the middle of the webpage has been hit. The `bottom` will scroll the webpage all the way to the bottom of the page.\n \n The default is `middle`.\n","uniqueKey":"oneOf.0.properties.background_scroll_depth","typeLabel":"string"},"background_scroll_return":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\nThis parameter defines the scrolling behavior once the webpage has been scrolled to the depth specified by the `background_scroll_depth` parameter.\n\nThere are two options: `return`, `halt`.\n\nThe `return` option will scroll back up once the webpage has reached `background_scroll_depth`. The `halt` option will pause the background video at the location specified in `background_scroll_depth`.\n\nThe default is `return`.\n","uniqueKey":"oneOf.0.properties.background_scroll_return","typeLabel":"string"},"start_with_wave":{"type":"boolean","description":"If set to true, the video will start with a wave animation. This is only supported for select stock faces.\n\nThe default is `true`.\n","example":true,"uniqueKey":"oneOf.0.properties.start_with_wave","typeLabel":"boolean"}},"uniqueKey":"oneOf.0.properties","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"Generate from Text · object"},{"type":"object","title":"Generate from Audio File","required":["replica_id","audio_url"],"properties":{"audio_url":{"type":"string","description":"A download link to a .wav or .mp3 file that is publicly accessible via a storage location such as an S3 bucket. This audio file will be used as the audio for the generated video.","isRequired":true,"uniqueKey":"oneOf.1.audio_url","typeLabel":"string"},"replica_id":{"type":"string","description":"The Face ID to render in the video (same resource as `face_id` on `/v2/faces`; this endpoint still accepts `replica_id`).","example":"rc9cff32ceba","isRequired":true,"uniqueKey":"oneOf.1.replica_id","typeLabel":"string"},"video_name":{"type":"string","description":"A name for the video.","example":"My First Video","uniqueKey":"oneOf.1.video_name","typeLabel":"string"},"background_url":{"type":"string","description":"A link to a website. This will be used as the background for the video. The website must be publicly accessible and properly formed.","example":"https://yourwebsite.com/","uniqueKey":"oneOf.1.background_url","typeLabel":"string"},"background_source_url":{"type":"string","description":"A direct link to a video that is publicly accessible via a storage location such as an S3 bucket. This will be used as the background for the video. The video must be publicly accessible.","example":"https://my-example-bucket.s3.us-east-1.amazonaws.com/your-background-video.mp4","uniqueKey":"oneOf.1.background_source_url","typeLabel":"string"},"callback_url":{"type":"string","description":"A url that will receive a callback on completion of video generation or on error.","example":"https://yourwebsite.com/webhook","uniqueKey":"oneOf.1.callback_url","typeLabel":"string"},"fast":{"type":"boolean","description":"If set to true, the video will be generated using a barebones fast rendering process. This will result in a faster generation of the video but some features will be disabled. Features such as background generation, thumbnail images, and streaming urls are not supported when using this fast rendering process.","example":false,"uniqueKey":"oneOf.1.fast","typeLabel":"boolean"},"transparent_background":{"type":"boolean","description":"If set to true, the generated video will be a `.webm` video with a transparent background.\n\nPlease note that this feature only works if the `fast` parameter is set to `true`.\n","example":false,"uniqueKey":"oneOf.1.transparent_background","typeLabel":"boolean"},"watermark_image_url":{"type":"string","description":"A direct link to a image that is publicly accessible via a storage location such as an S3 bucket. This will be used as the watermark on the video. Currently, it support `png` \u0026 `jpeg` formats only. Ensure the image is publicly accessible.","example":"https://s3.amazonaws.com/watermark.png","uniqueKey":"oneOf.1.watermark_image_url","typeLabel":"string"},"properties":{"type":"object","properties":{"background_scroll":{"type":"boolean","description":"If `background_url` is provided, this option may be configured.\n\nIf set to `true`, the background video will scroll down through the website. If set to `false`, the background video will display the top of the website. \n\nThe default is `true`.\n","example":true,"uniqueKey":"oneOf.1.properties.background_scroll","typeLabel":"boolean"},"background_scroll_type":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\nThis parameter defines the scroll pattern if `background_scroll` is set to `true`. \n\nThere are two options: `human`, `smooth`. \n\nThe `human` scroll type is the default type and mimics a human scrolling through the webpage, briefly stopping at certain intervals to give a natural appearance. The `smooth` scroll type scroll in a uniform manner all the way down the website without stopping.\n\nThe default is `human`.\n","uniqueKey":"oneOf.1.properties.background_scroll_type","typeLabel":"string"},"background_scroll_depth":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\n This parameter defines how far down the webpage the background video will scroll.\n \n There are two options: `middle`, `bottom`.\n \n The `middle` depth option will stop scrolling once the middle of the webpage has been hit. The `bottom` will scroll the webpage all the way to the bottom of the page.\n \n The default is `middle`.\n","uniqueKey":"oneOf.1.properties.background_scroll_depth","typeLabel":"string"},"background_scroll_return":{"type":"string","description":"If `background_url` is provided and `background_scroll` is set to `true`, this option may be configured.\n\nThis parameter defines the scrolling behavior once the webpage has been scrolled to the depth specified by the `background_scroll_depth` parameter.\n\nThere are two options: `return`, `halt`.\n\nThe `return` option will scroll back up once the webpage has reached `background_scroll_depth`. The `halt` option will pause the background video at the location specified in `background_scroll_depth`.\n\nThe default is `return`.\n","uniqueKey":"oneOf.1.properties.background_scroll_return","typeLabel":"string"},"start_with_wave":{"type":"boolean","description":"If set to true, the video will start with a wave animation. This is only supported for select stock faces.\n\nThe default is `true`.\n","example":true,"uniqueKey":"oneOf.1.properties.start_with_wave","typeLabel":"boolean"}},"uniqueKey":"oneOf.1.properties","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"Generate from Audio File · object"}],"uniqueKey":"","typeLabel":"Generate from Text · object | Generate from Audio File · object"},"examples":{"Generate Video":{"title":"Generate Video","value":{"background_url":"https://yourwebsite.com/","replica_id":"rc9cff32ceba","script":"Hi, this is my first video.","video_name":"My First Video"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"9f7d2d48-78f2-4ae8-be04-fe1188926446":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string","example":"abcd123","description":"A unique identifier for the video.","uniqueKey":"video_id","typeLabel":"string"},"video_name":{"type":"string","example":"Sample Video","description":"The name of the video.","uniqueKey":"video_name","typeLabel":"string"},"status":{"type":"string","example":"queued","description":"The status of the video. Possible values: queued, generating, ready, deleted, error.","uniqueKey":"status","typeLabel":"string"},"hosted_url":{"type":"string","example":"https://tavus.video/abcd123","description":"A direct link to view your video once generation has completed, hosted by Tavus.","uniqueKey":"hosted_url","typeLabel":"string"},"created_at":{"type":"string","example":"Mon, 14 Jul 2025 09:14:24 GMT","description":"The date and time the video was created.","uniqueKey":"created_at","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"video_id":"abcd123","video_name":"Sample Video","status":"queued","hosted_url":"https://tavus.video/abcd123","created_at":"Mon, 14 Jul 2025 09:14:24 GMT"}}},"exampleType":"generated"}},"exampleType":"generated"},"022294ab-ce69-4e6a-ade1-b26c4538cc94":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The error message.","example":"Invalid replica_id","uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"Invalid replica_id"}}},"exampleType":"generated"}},"exampleType":"generated"},"d2ae466d-8745-44b4-8f33-8c98a16729ba":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The error message.","example":"Invalid access token","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"Invalid access token"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"2d36cd34-d350-481c-9008-1b5b3e90e82a":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"apiKey"}}},"servers":{"6012df5b-a62b-406c-b32a-b2804c3b92cf":{"url":"https://tavusapi.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"apiKey"},"schema":{"title":"x-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"apiKey","name":"x-api-key"}],"title":"apiKey"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"tavus","siteName":"Tavus","title":"Generate Video - Tavus","contextualStarterQuestions":[{"_id":"6a3ecac8d80e0e9f33107a62","deploymentId":"65baa7516ce8cd46ab1aa877","questionText":"Can I use audio or script?","status":"active","generatedBy":"contextual","path":"api-reference/video-request/create-video","createdAt":"2026-06-26T18:54:00.991Z","updatedAt":"2026-06-26T18:54:00.991Z","__v":0},{"_id":"6a3ecac8d80e0e9f33107a60","deploymentId":"65baa7516ce8cd46ab1aa877","questionText":"How do I generate a video?","status":"active","generatedBy":"contextual","path":"api-reference/video-request/create-video","createdAt":"2026-06-26T18:54:00.991Z","updatedAt":"2026-06-26T18:54:00.991Z","__v":0},{"_id":"6a3ecac8d80e0e9f33107a61","deploymentId":"65baa7516ce8cd46ab1aa877","questionText":"What inputs does video generation need?","status":"active","generatedBy":"contextual","path":"api-reference/video-request/create-video","createdAt":"2026-06-26T18:54:00.991Z","updatedAt":"2026-06-26T18:54:00.991Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-26T18:51:25.274Z","originalFileLocation":"api-reference/video-request/create-video.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"This endpoint generates a new video using a face and either a script or an audio file.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tavus\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate Video - Tavus\">\u003cmeta data-mint-head property=\"og:description\" content=\"This endpoint generates a new video using a face and either a script or an audio file.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tavus\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tavus.io/api-reference/video-request/create-video\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tavus.mintlify.app/_mintlify/api/og/v2?division=Video+Generation+API\u0026amp;title=Generate+Video\u0026amp;description=This+endpoint+generates+a+new+video+using+a+face+and+either+a+script+or+an+audio+file.%0A\u0026amp;theme=91cafe4cc1af35a0828d7f58\u0026amp;signature=78b6d35856b71c76e6ae0e6d0b28c928f6c63816943ddc9e88484bdc2c1b4cbc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Generate Video - Tavus\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This endpoint generates a new video using a face and either a script or an audio file.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tavus.mintlify.app/_mintlify/api/og/v2?division=Video+Generation+API\u0026amp;title=Generate+Video\u0026amp;description=This+endpoint+generates+a+new+video+using+a+face+and+either+a+script+or+an+audio+file.%0A\u0026amp;theme=91cafe4cc1af35a0828d7f58\u0026amp;signature=78b6d35856b71c76e6ae0e6d0b28c928f6c63816943ddc9e88484bdc2c1b4cbc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tavus/Gv5r0opZCeHlefXw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tavus\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FA3862\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tavus.io/api-reference/video-request/create-video\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/video-request/create-video.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tavus.io/#organization\",\"name\":\"Tavus\",\"url\":\"https://docs.tavus.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tavus/mlBBb4gkXXhWTLQi/logo/light_logo.png?fit=max\u0026auto=format\u0026n=mlBBb4gkXXhWTLQi\u0026q=85\u0026s=892e020f9d0afc49e64011dcae9d3dd6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tavus.io#website\",\"name\":\"Tavus\",\"url\":\"https://docs.tavus.io\",\"publisher\":{\"@id\":\"https://docs.tavus.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tavus.io/api-reference/video-request/create-video#webpage\",\"url\":\"https://docs.tavus.io/api-reference/video-request/create-video\",\"name\":\"Generate Video\",\"description\":\"This endpoint generates a new video using a face and either a script or an audio file.\",\"dateModified\":\"2026-06-26T18:51:25.274Z\",\"isPartOf\":{\"@id\":\"https://docs.tavus.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tavus.io/api-reference/video-request/create-video#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tavus.io/api-reference/video-request/create-video#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Video Generation\",\"item\":\"https://docs.tavus.io/sections/video/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate Video\",\"item\":\"https://docs.tavus.io/api-reference/video-request/create-video\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.tavus.io/api-reference/video-request/create-video#apireference\",\"headline\":\"Generate Video\",\"name\":\"Generate Video\",\"description\":\"This endpoint generates a new video using a face and either a script or an audio file.\",\"url\":\"https://docs.tavus.io/api-reference/video-request/create-video\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tavus.io/api-reference/video-request/create-video#webpage\"},\"dateModified\":\"2026-06-26T18:51:25.274Z\",\"keywords\":\"replica, replica_id, face, face_id\",\"publisher\":{\"@id\":\"https://docs.tavus.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tavus.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tavus\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Tavus","nav":{"global":null,"tabs":[{"tab":"CVI","pages":[{"title":"CVI","href":"/sections/introduction"}]},{"tab":"API","pages":[{"title":"API","href":"/api-reference/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/sections/changelog/changelog"}]},{"tab":"Other Products","groups":[{"group":"Video Generation","icon":"video","pages":[{"title":"Overview","sidebarTitle":"Video overview","href":"/sections/video/overview"},{"title":"Quickstart","sidebarTitle":"Video quickstart","href":"/sections/video/quickstart"},{"title":"Background Customizations","description":"Customize AI video backgrounds with transparency, scrolling websites, or custom video sources.","href":"/sections/video/background-customizations"},{"group":"Video Generation API","pages":[{"openapi":"post /v2/videos","title":"Generate Video","href":"/api-reference/video-request/create-video"},{"openapi":"get /v2/videos/{video_id}","title":"Get Video","description":"This endpoint returns a single video by its unique identifier.\n","href":"/api-reference/video-request/get-video"},{"openapi":"get /v2/videos","title":"List Videos","href":"/api-reference/video-request/get-videos"},{"openapi":"delete /v2/videos/{video_id}","title":"Delete Video","href":"/api-reference/video-request/delete-video"},{"openapi":"patch /v2/videos/{video_id}/name","title":"Rename Video","href":"/api-reference/video-request/patch-video-name"}]}]}]},{"tab":"Enablement Docs","hidden":true,"pages":[{"title":"Enablement Docs","href":"/sections/enablement-docs"}]}]},"basePath":"","title":"Generate Video - Tavus","buildId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","deploymentId":"dpl_345ReqzYaAjzS9QpeJemsKdb7KDj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C8RPHPxo.js","utils-0BK-9q6z.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DfjzsUJT.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B4v9psJ4.js","snippetPresets-CpTQv-Ez.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BNP-Fvr0.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BSgu6h1D.js","shallow-Biv1i9Gs.js","getApiPlaygroundDisplay-BoGOXhtF.js","CodeSnippet-DvQoT18_.js","CodeSnippets-Dnpa15xT.js","Page-Buji1S4J.js","getPastedJson-xAIyhUFE.js","icon-S6FBih11.js","MethodPill-SaYeUZyk.js","DuplicateIcon-Cs-p3v2Q.js","createIcon-DjCFEoHq.js","DynamicMarkdown-BcnBltEQ.js","SectionHeading-BUBl0eEF.js","axios-vUo_bRtp.js","Markdown-h4cOoD8d.js","clsx-B2v50t8t.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DJnKvr0g.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BHrrjR1K.js"]}