from magic_hour import Clientfrom os import getenvclient = Client(token=getenv("MAGIC_HOUR_API_KEY"))res = client.v1.text_to_video.generate( end_seconds=5.0, aspect_ratio="16:9", style={"prompt": "a dog running"}, name="Text To Video video", resolution="720p", wait_for_completion=True, download_outputs=True, download_directory=".")
import { Client } from "magic-hour";
const client = new Client({ token: process.env["MAGIC_HOUR_API_KEY"] });
const res = await client.v1.textToVideo.generate(
{
aspectRatio: "16:9",
endSeconds: 5.0,
name: "Text To Video video",
resolution: "720p",
style: { prompt: "a dog running" },
},
{
waitForCompletion: true,
downloadOutputs: true,
downloadDirectory: ".",
},
);
package main
import (
os "os"
sdk "github.com/magichourhq/magic-hour-go/client"
nullable "github.com/magichourhq/magic-hour-go/nullable"
text_to_video "github.com/magichourhq/magic-hour-go/resources/v1/text_to_video"
types "github.com/magichourhq/magic-hour-go/types"
)
func main() {
client := sdk.NewClient(
sdk.WithBearerAuth(os.Getenv("MAGIC_HOUR_API_KEY")),
)
res, err := client.V1.TextToVideo.Create(text_to_video.CreateRequest{
AspectRatio: nullable.NewValue(types.V1TextToVideoCreateBodyAspectRatioEnum169),
Audio: nullable.NewValue(true),
EndSeconds: 5.0,
Model: nullable.NewValue(types.V1TextToVideoCreateBodyModelEnumLtx25),
Name: nullable.NewValue("My Text To Video video"),
Resolution: nullable.NewValue(types.V1TextToVideoCreateBodyResolutionEnum480p),
Style: types.V1TextToVideoCreateBodyStyle{
Prompt: "a dog running",
},
})
}
let client = magic_hour::Client::default()
.with_bearer_auth(&std::env::var("MAGIC_HOUR_API_KEY").unwrap());
let res = client
.v1()
.text_to_video()
.create(magic_hour::resources::v1::text_to_video::CreateRequest {
aspect_ratio: Some(
magic_hour::models::V1TextToVideoCreateBodyAspectRatioEnum::Enum169,
),
audio: Some(true),
end_seconds: 5.0,
model: Some(magic_hour::models::V1TextToVideoCreateBodyModelEnum::Ltx25),
name: Some("My Text To Video video".to_string()),
resolution: Some(
magic_hour::models::V1TextToVideoCreateBodyResolutionEnum::Enum480p,
),
style: magic_hour::models::V1TextToVideoCreateBodyStyle {
prompt: "a dog running".to_string(),
..Default::default()
},
..Default::default()
})
.await;
Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.
Good for
Automation and batch processing
Adding text to video into apps, pipelines, or tools
How it works (3 steps)
Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path.
Send a request to create a text to video job with the basic fields.
Check the job status until it’s complete, then download the result from downloads.
Key options
Inputs: usually a file, sometimes a YouTube link, depending on project type
Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.
Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt
Cost
Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.
from magic_hour import Clientfrom os import getenvclient = Client(token=getenv("MAGIC_HOUR_API_KEY"))res = client.v1.text_to_video.generate( end_seconds=5.0, aspect_ratio="16:9", style={"prompt": "a dog running"}, name="Text To Video video", resolution="720p", wait_for_completion=True, download_outputs=True, download_directory=".")
import { Client } from "magic-hour";
const client = new Client({ token: process.env["MAGIC_HOUR_API_KEY"] });
const res = await client.v1.textToVideo.generate(
{
aspectRatio: "16:9",
endSeconds: 5.0,
name: "Text To Video video",
resolution: "720p",
style: { prompt: "a dog running" },
},
{
waitForCompletion: true,
downloadOutputs: true,
downloadDirectory: ".",
},
);
package main
import (
os "os"
sdk "github.com/magichourhq/magic-hour-go/client"
nullable "github.com/magichourhq/magic-hour-go/nullable"
text_to_video "github.com/magichourhq/magic-hour-go/resources/v1/text_to_video"
types "github.com/magichourhq/magic-hour-go/types"
)
func main() {
client := sdk.NewClient(
sdk.WithBearerAuth(os.Getenv("MAGIC_HOUR_API_KEY")),
)
res, err := client.V1.TextToVideo.Create(text_to_video.CreateRequest{
AspectRatio: nullable.NewValue(types.V1TextToVideoCreateBodyAspectRatioEnum169),
Audio: nullable.NewValue(true),
EndSeconds: 5.0,
Model: nullable.NewValue(types.V1TextToVideoCreateBodyModelEnumLtx25),
Name: nullable.NewValue("My Text To Video video"),
Resolution: nullable.NewValue(types.V1TextToVideoCreateBodyResolutionEnum480p),
Style: types.V1TextToVideoCreateBodyStyle{
Prompt: "a dog running",
},
})
}
let client = magic_hour::Client::default()
.with_bearer_auth(&std::env::var("MAGIC_HOUR_API_KEY").unwrap());
let res = client
.v1()
.text_to_video()
.create(magic_hour::resources::v1::text_to_video::CreateRequest {
aspect_ratio: Some(
magic_hour::models::V1TextToVideoCreateBodyAspectRatioEnum::Enum169,
),
audio: Some(true),
end_seconds: 5.0,
model: Some(magic_hour::models::V1TextToVideoCreateBodyModelEnum::Ltx25),
name: Some("My Text To Video video".to_string()),
resolution: Some(
magic_hour::models::V1TextToVideoCreateBodyResolutionEnum::Enum480p,
),
style: magic_hour::models::V1TextToVideoCreateBodyStyle {
prompt: "a dog running".to_string(),
..Default::default()
},
..Default::default()
})
.await;
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video.
If video generation fails, credits will be refunded, and this field will be updated to include the refund.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Magic Hour API Docs","description":"Easily generate videos, images, and audio using Magic Hour's API. Follow our documentation to seamlessly integrate AI content creation into your applications.","colors":{"primary":"#3b82f6","light":"#0564ff","dark":"#3b82f6"},"logo":{"light":"https://mintcdn.com/magichour/5sgGJpuuipkw5s5v/icons/logo-light.svg?fit=max\u0026auto=format\u0026n=5sgGJpuuipkw5s5v\u0026q=85\u0026s=1f167e30baf11927bc2e0932411e455b","dark":"https://mintcdn.com/magichour/5sgGJpuuipkw5s5v/icons/logo-dark.svg?fit=max\u0026auto=format\u0026n=5sgGJpuuipkw5s5v\u0026q=85\u0026s=15c8bda28931ac4e1e2fab2c0ba6f0d5"},"favicon":"https://mintcdn.com/magichour/kbUwXh9ksnVyRSci/icons/favicon.png?fit=max\u0026auto=format\u0026n=kbUwXh9ksnVyRSci\u0026q=85\u0026s=c4fda903b24dd7067dadd1bb75508987","appearance":{"default":"dark","strict":false},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"mailto:support@magichour.ai","label":"Support"}],"primary":{"type":"button","label":"Get API key","href":"https://magichour.ai/developer?tab=api-keys\u0026ref=docs-navbar\u0026utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=navbar"}},"footer":{"socials":{"website":"https://magichour.ai/?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=footer","x":"https://x.com/magichourai","github":"https://github.com/magichourhq","linkedin":"https://linkedin.com/company/magichour","instagram":"https://instagram.com/magichourai","youtube":"https://youtube.com/@magichourai"}},"seo":{"metatags":{"og:image":"https://d28dkohlqf5vwj.cloudfront.net/open-graph/logo-social-noisy-spectrum.jpg","twitter:image":"https://d28dkohlqf5vwj.cloudfront.net/open-graph/logo-social-noisy-spectrum.jpg"}},"integrations":{"ga4":{"measurementId":"G-CZ9Q9NBZB3"},"posthog":{"apiKey":"phc_EmzSy2RU0TOPhpouazMzxFedNdMyhze8HakyjffW2Wr","apiHost":"https://us.i.posthog.com"}},"contextual":{"options":["chatgpt","claude","perplexity","mcp","cursor","vscode","copy","view"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"API quickstart","icon":"forward-fast","href":"/get-started/quick-start"},{"anchor":"API pricing","icon":"credit-card","href":"/billing/overview"},{"anchor":"Community","icon":"discord","href":"https://discord.com/invite/JX5rgsZaJp"},{"anchor":"Status","icon":"wave-pulse","href":"https://status.magichour.ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"magichour","hasAudioNarration":false,"actualSubdomain":"magichour","customDomains":["docs.magichour.ai"],"gitSource":{"type":"github","owner":"magichourhq","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae36fc26dca5a83b8f3aeca","collectionId":"b8b7d9ef-9046-4620-ba2f-41ff567b76bf","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae36fc26dca5a83b8f3aeca"},"feedback":{"thumbs":true,"issues":true,"edits":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae36fc26dca5a83b8f3aeca","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Documentation","count":97},{"language":"default","tag":"Integration","count":56},{"language":"default","tag":"API Reference","count":45},{"language":"default","tag":"Tools","count":30},{"language":"default","tag":"Image Projects","count":16},{"language":"default","tag":"Video Projects","count":16},{"language":"default","tag":"Images","count":15},{"language":"default","tag":"Video","count":12},{"language":"default","tag":"Webhook Reference","count":10},{"language":"default","tag":"Get Started","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#sidebar,#table-of-contents-content{scrollbar-width:thin;scrollbar-gutter:none;scrollbar-color:gray transparent}"}],"page":{"pagePath":"api-reference/video-projects/text-to-video","slug":"/api-reference/video-projects/text-to-video","pageMetadata":{"openapi":"post /v1/text-to-video","title":"Text-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Text-to-Video","description":"**What this API does**\n\nCreate the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding text to video into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a text to video job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/text-to-video).","href":"/api-reference/video-projects/text-to-video"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n br: \"br\",\n code: \"code\",\n li: \"li\",\n ol: \"ol\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"What this API does\"\n })\n }), \"\\n\", _jsx(_components.p, {\n children: \"Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\"\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Good for\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"Automation and batch processing\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Adding text to video into apps, pipelines, or tools\"\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"How it works (3 steps)\"\n })\n }), \"\\n\", _jsxs(_components.ol, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Upload your inputs (video, image, or audio) with \", _jsx(_components.a, {\n href: \"https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls\",\n children: \"Generate Upload URLs\"\n }), \" and copy the \", _jsx(_components.code, {\n children: \"file_path\"\n }), \".\"]\n }), \"\\n\", _jsx(_components.li, {\n children: \"Send a request to create a text to video job with the basic fields.\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Check the job status until it’s \", _jsx(_components.code, {\n children: \"complete\"\n }), \", then download the result from \", _jsx(_components.code, {\n children: \"downloads\"\n }), \".\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Key options\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"Inputs: usually a file, sometimes a YouTube link, depending on project type\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Extra fields: e.g. \", _jsx(_components.code, {\n children: \"face_swap_mode\"\n }), \", \", _jsx(_components.code, {\n children: \"start_seconds\"\n }), \"/\", _jsx(_components.code, {\n children: \"end_seconds\"\n }), \", or a text prompt\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Cost\"\n }), _jsx(_components.br, {}), \"\\n\", \"Credits are charged when the job is queued (\", _jsx(_components.code, {\n children: \"credits_charged\"\n }), \" in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"For detailed examples, see the \", _jsx(_components.a, {\n href: \"https://magichour.ai/products/text-to-video\",\n children: \"product page\"\n }), \".\"]\n })]\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{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /v1/text-to-video","title":"Text-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Text-to-Video","description":"**What this API does**\n\nCreate the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding text to video into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a text to video job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/text-to-video).","href":"/api-reference/video-projects/text-to-video"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"**What this API does**\n\nCreate the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding text to video into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a text to video job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/text-to-video).","summary":"Text-to-Video","tags":["Video Projects"],"parameters":[],"operationId":"textToVideo.createVideo","requestBody":"3fe4e0b2-ae0c-41f2-9c4c-0d7bae3ecdb4","responses":{"200":"6ffccff6-67d4-4a05-abf5-22c98482d331","400":"99afefa6-d41c-445d-a547-4a607854f5fc","401":"998ffb1a-76f3-4db1-800c-c4ba813b1232","402":"a03427ea-65f6-4770-ad24-8ee22f609043","404":"d2bdead2-1520-4d42-aad3-0944879b30a9","422":"323255cc-044b-4b86-9d5c-b054ad7326be","500":"ca22b456-5005-4ca4-9c51-4d485dea044a"},"security":["c303e3a7-e91b-44e4-8c15-3edae2cf529e"],"x-codeSamples":[{"lang":"python","source":"from magic_hour import Client\nfrom os import getenv\n\nclient = Client(token=getenv(\"MAGIC_HOUR_API_KEY\"))\nres = client.v1.text_to_video.generate(\n end_seconds=5.0,\n aspect_ratio=\"16:9\",\n style={\"prompt\": \"a dog running\"},\n name=\"Text To Video video\",\n resolution=\"720p\",\n wait_for_completion=True,\n download_outputs=True,\n download_directory=\".\"\n)"},{"lang":"javascript","source":"import { Client } from \"magic-hour\";\n\nconst client = new Client({ token: process.env[\"MAGIC_HOUR_API_KEY\"] });\nconst res = await client.v1.textToVideo.generate(\n {\n aspectRatio: \"16:9\",\n endSeconds: 5.0,\n name: \"Text To Video video\",\n resolution: \"720p\",\n style: { prompt: \"a dog running\" },\n },\n {\n waitForCompletion: true,\n downloadOutputs: true,\n downloadDirectory: \".\",\n },\n);"},{"lang":"go","source":"package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tnullable \"github.com/magichourhq/magic-hour-go/nullable\"\n\ttext_to_video \"github.com/magichourhq/magic-hour-go/resources/v1/text_to_video\"\n\ttypes \"github.com/magichourhq/magic-hour-go/types\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"MAGIC_HOUR_API_KEY\")),\n\t)\n\tres, err := client.V1.TextToVideo.Create(text_to_video.CreateRequest{\n\t\tAspectRatio: nullable.NewValue(types.V1TextToVideoCreateBodyAspectRatioEnum169),\n\t\tAudio: nullable.NewValue(true),\n\t\tEndSeconds: 5.0,\n\t\tModel: nullable.NewValue(types.V1TextToVideoCreateBodyModelEnumLtx25),\n\t\tName: nullable.NewValue(\"My Text To Video video\"),\n\t\tResolution: nullable.NewValue(types.V1TextToVideoCreateBodyResolutionEnum480p),\n\t\tStyle: types.V1TextToVideoCreateBodyStyle{\n\t\t\tPrompt: \"a dog running\",\n\t\t},\n\t})\n}"},{"lang":"rust","source":"let client = magic_hour::Client::default()\n .with_bearer_auth(\u0026std::env::var(\"MAGIC_HOUR_API_KEY\").unwrap());\nlet res = client\n .v1()\n .text_to_video()\n .create(magic_hour::resources::v1::text_to_video::CreateRequest {\n aspect_ratio: Some(\n magic_hour::models::V1TextToVideoCreateBodyAspectRatioEnum::Enum169,\n ),\n audio: Some(true),\n end_seconds: 5.0,\n model: Some(magic_hour::models::V1TextToVideoCreateBodyModelEnum::Ltx25),\n name: Some(\"My Text To Video video\".to_string()),\n resolution: Some(\n magic_hour::models::V1TextToVideoCreateBodyResolutionEnum::Enum480p,\n ),\n style: magic_hour::models::V1TextToVideoCreateBodyStyle {\n prompt: \"a dog running\".to_string(),\n ..Default::default()\n },\n ..Default::default()\n })\n .await;"},{"lang":"curl","source":"curl --request POST \\\n --url https://api.magichour.ai/v1/text-to-video \\\n --header 'accept: application/json' \\\n --header \"authorization: Bearer $MAGIC_HOUR_API_KEY\" \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"end_seconds\": 5,\n \"aspect_ratio\": \"16:9\",\n \"style\": {\n \"prompt\": \"a dog running\"\n }\n}\n'"},{"lang":"php","source":"\u003c?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.magichour.ai/v1/text-to-video\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'end_seconds' => 5,\n 'aspect_ratio' => '16:9',\n 'style' => [\n 'prompt' => 'a dog running'\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer \u003ctoken>\",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"},{"lang":"java","source":"HttpResponse\u003cString> response = Unirest.post(\"https://api.magichour.ai/v1/text-to-video\")\n .header(\"accept\", \"application/json\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Bearer \u003ctoken>\")\n .body(\"{\\\"end_seconds\\\":5,\\\"aspect_ratio\\\":\\\"16:9\\\",\\\"style\\\":{\\\"prompt\\\":\\\"a dog running\\\"}}\")\n .asString();"}],"method":"post","type":"path","servers":["9d7d9813-e8f8-4d8d-bab1-aec4a4bedf19"],"path":"/v1/text-to-video","baseUrlOptions":["https://api.magichour.ai"],"title":"Text-to-Video","codeSamples":[{"lang":"python","source":"from magic_hour import Client\nfrom os import getenv\n\nclient = Client(token=getenv(\"MAGIC_HOUR_API_KEY\"))\nres = client.v1.text_to_video.generate(\n end_seconds=5.0,\n aspect_ratio=\"16:9\",\n style={\"prompt\": \"a dog running\"},\n name=\"Text To Video video\",\n resolution=\"720p\",\n wait_for_completion=True,\n download_outputs=True,\n download_directory=\".\"\n)"},{"lang":"javascript","source":"import { Client } from \"magic-hour\";\n\nconst client = new Client({ token: process.env[\"MAGIC_HOUR_API_KEY\"] });\nconst res = await client.v1.textToVideo.generate(\n {\n aspectRatio: \"16:9\",\n endSeconds: 5.0,\n name: \"Text To Video video\",\n resolution: \"720p\",\n style: { prompt: \"a dog running\" },\n },\n {\n waitForCompletion: true,\n downloadOutputs: true,\n downloadDirectory: \".\",\n },\n);"},{"lang":"go","source":"package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tnullable \"github.com/magichourhq/magic-hour-go/nullable\"\n\ttext_to_video \"github.com/magichourhq/magic-hour-go/resources/v1/text_to_video\"\n\ttypes \"github.com/magichourhq/magic-hour-go/types\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"MAGIC_HOUR_API_KEY\")),\n\t)\n\tres, err := client.V1.TextToVideo.Create(text_to_video.CreateRequest{\n\t\tAspectRatio: nullable.NewValue(types.V1TextToVideoCreateBodyAspectRatioEnum169),\n\t\tAudio: nullable.NewValue(true),\n\t\tEndSeconds: 5.0,\n\t\tModel: nullable.NewValue(types.V1TextToVideoCreateBodyModelEnumLtx25),\n\t\tName: nullable.NewValue(\"My Text To Video video\"),\n\t\tResolution: nullable.NewValue(types.V1TextToVideoCreateBodyResolutionEnum480p),\n\t\tStyle: types.V1TextToVideoCreateBodyStyle{\n\t\t\tPrompt: \"a dog running\",\n\t\t},\n\t})\n}"},{"lang":"rust","source":"let client = magic_hour::Client::default()\n .with_bearer_auth(\u0026std::env::var(\"MAGIC_HOUR_API_KEY\").unwrap());\nlet res = client\n .v1()\n .text_to_video()\n .create(magic_hour::resources::v1::text_to_video::CreateRequest {\n aspect_ratio: Some(\n magic_hour::models::V1TextToVideoCreateBodyAspectRatioEnum::Enum169,\n ),\n audio: Some(true),\n end_seconds: 5.0,\n model: Some(magic_hour::models::V1TextToVideoCreateBodyModelEnum::Ltx25),\n name: Some(\"My Text To Video video\".to_string()),\n resolution: Some(\n magic_hour::models::V1TextToVideoCreateBodyResolutionEnum::Enum480p,\n ),\n style: magic_hour::models::V1TextToVideoCreateBodyStyle {\n prompt: \"a dog running\".to_string(),\n ..Default::default()\n },\n ..Default::default()\n })\n .await;"},{"lang":"curl","source":"curl --request POST \\\n --url https://api.magichour.ai/v1/text-to-video \\\n --header 'accept: application/json' \\\n --header \"authorization: Bearer $MAGIC_HOUR_API_KEY\" \\\n --header 'content-type: application/json' \\\n --data '\n{\n \"end_seconds\": 5,\n \"aspect_ratio\": \"16:9\",\n \"style\": {\n \"prompt\": \"a dog running\"\n }\n}\n'"},{"lang":"php","source":"\u003c?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n CURLOPT_URL => \"https://api.magichour.ai/v1/text-to-video\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode([\n 'end_seconds' => 5,\n 'aspect_ratio' => '16:9',\n 'style' => [\n 'prompt' => 'a dog running'\n ]\n ]),\n CURLOPT_HTTPHEADER => [\n \"accept: application/json\",\n \"authorization: Bearer \u003ctoken>\",\n \"content-type: application/json\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}"},{"lang":"java","source":"HttpResponse\u003cString> response = Unirest.post(\"https://api.magichour.ai/v1/text-to-video\")\n .header(\"accept\", \"application/json\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Bearer \u003ctoken>\")\n .body(\"{\\\"end_seconds\\\":5,\\\"aspect_ratio\\\":\\\"16:9\\\",\\\"style\\\":{\\\"prompt\\\":\\\"a dog running\\\"}}\")\n .asString();"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"description":"Body","content":{"application/json":{"schema":{"type":"object","properties":{"end_seconds":{"type":"number","minimum":1,"maximum":60,"description":"The total duration of the output video in seconds. Supported durations depend on the chosen model:\n\n* **`gemini-omni-1.1`**: any integer from 3 to 10\n* **`kling-2.6`**: 5, 10\n* **`kling-3.0`**: any integer from 3 to 15\n* **`ltx-2.5`**: any integer from 1 to 60\n* **`minimax-h3`**: any integer from 1 to 30\n* **`seedance-1.5`**: any integer from 4 to 12\n* **`seedance-2.0`**: any integer from 4 to 15\n* **`seedance-2.0-fast`**: any integer from 4 to 15\n* **`seedance-2.0-mini`**: any integer from 4 to 15\n* **`seedance-2.5`**: any integer from 4 to 30\n* **`veo3.1`**: 4, 6, 8, 16, 24, 32, 40, 48, 56\n* **`veo3.1-lite`**: 4, 6, 8, 16, 24, 32, 40, 48, 56\n* **`wan-2.2`**: 3, 4, 5, 6, 7, 8, 9, 10, 15\n* **`wan-3.0`**: 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30\n","format":"float","example":5,"isRequired":true,"uniqueKey":"end_seconds","typeLabel":"number\u003cfloat>"},"style":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":20000,"example":"a dog running","description":"The prompt used for the video.","isRequired":true,"uniqueKey":"style.prompt","typeLabel":"string"}},"required":["prompt"],"isRequired":true,"uniqueKey":"style","typeLabel":"object"},"name":{"type":"string","description":"Give your video a custom name for easy identification.","example":"My Text To Video video","default":"Text To Video - dateTime","uniqueKey":"name","typeLabel":"string"},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"],"description":"Provide `aspect_ratio` to set the video’s aspect ratio. Determines the aspect ratio of the output video.\n\n* **`gemini-omni-1.1`**: Supports 16:9, 9:16.\n* **`kling-2.6`**: Supports 9:16, 16:9, 1:1.\n* **`kling-3.0`**: Supports 9:16, 16:9, 1:1.\n* **`ltx-2.5`**: Supports 9:16, 16:9, 1:1.\n* **`minimax-h3`**: Supports 16:9, 9:16, 1:1.\n* **`seedance-1.5`**: Supports 9:16, 16:9, 1:1.\n* **`seedance-2.0`**: Supports 9:16, 16:9, 1:1.\n* **`seedance-2.0-fast`**: Supports 9:16, 16:9, 1:1.\n* **`seedance-2.0-mini`**: Supports 9:16, 16:9, 1:1.\n* **`seedance-2.5`**: Supports 9:16, 16:9, 1:1.\n* **`veo3.1`**: Supports 9:16, 16:9.\n* **`veo3.1-lite`**: Supports 9:16, 16:9.\n* **`wan-2.2`**: Supports 9:16, 16:9, 1:1.\n* **`wan-3.0`**: Supports 16:9, 9:16, 1:1.\n","example":"16:9","uniqueKey":"aspect_ratio","typeLabel":"enum\u003cstring>"},"resolution":{"type":"string","enum":["360p","480p","720p","1080p","4k"],"example":"480p","description":"Controls the output video resolution. Defaults to `720p` on paid tiers and `480p` on free tiers.\n\n* **`gemini-omni-1.1`**: Supports 360p, 720p, 1080p, 4k.\n* **`kling-2.6`**: Supports 720p, 1080p.\n* **`kling-3.0`**: Supports 720p, 1080p, 4k.\n* **`ltx-2.5`**: Supports 480p, 720p, 1080p.\n* **`minimax-h3`**: Supports 480p, 720p, 1080p.\n* **`seedance-1.5`**: Supports 480p, 720p, 1080p.\n* **`seedance-2.0`**: Supports 480p, 720p, 1080p, 4k.\n* **`seedance-2.0-fast`**: Supports 480p, 720p.\n* **`seedance-2.0-mini`**: Supports 480p, 720p.\n* **`seedance-2.5`**: Supports 480p, 720p, 1080p.\n* **`veo3.1`**: Supports 720p, 1080p.\n* **`veo3.1-lite`**: Supports 720p, 1080p.\n* **`wan-2.2`**: Supports 480p, 720p, 1080p.\n* **`wan-3.0`**: Supports 480p, 720p, 1080p.\n","uniqueKey":"resolution","typeLabel":"enum\u003cstring>"},"model":{"default":"default","type":"string","enum":["default","minimax-h3","kling-3.0","ltx-2.5","wan-2.2","seedance-2.5","wan-3.0","seedance-2.0-mini","veo3.1","veo3.1-lite","seedance-2.0","kling-2.6","gemini-omni-1.1","seedance-2.0-fast","seedance-1.5","sora-2","ltx-2.3","ltx-2","kling-2.5","kling-1.6","seedance","kling-2.5-audio","veo3.1-audio"],"description":"The AI model to use for video generation.\n\n* `default`: uses our currently recommended model for general use. For paid tiers, defaults to `kling-3.0`. For free tiers, it defaults to `ltx-2.5`.\n* `gemini-omni-1.1`: Best for precise short clips, first/last frames, and high-resolution output.\n* `kling-2.6`: Best for action, motion blur, and controlled camera moves.\n* `kling-3.0`: Best for cinematic stories, references, and optional audio.\n* `ltx-2.5`: Fastest for general scenes, long clips, audio, and rapid iteration.\n* `minimax-h3`: Great for reference-driven clips with native audio and longer durations.\n* `seedance-1.5`: Best for smooth, consistent motion with an end frame.\n* `seedance-2.0`: Best for reference-led clips with precise subject control.\n* `seedance-2.0-fast`: Fast reference-led clips with consistent motion and audio.\n* `seedance-2.0-mini`: Faster reference-led clips with consistent motion and audio.\n* `seedance-2.5`: Best for premium realism, detail, and natural motion.\n* `veo3.1`: Best for romantic interactions and expressive action, with realistic detail.\n* `veo3.1-lite`: Balanced realism and audio at a lower cost than Veo 3.1.\n* `wan-2.2`: Best for physical motion, action, and camera movement.\n* `wan-3.0`: High-quality video with native audio, long clips, and end-frame control.\n\nIf you specify the deprecated model value that includes the `-audio` suffix, this will be the same as included `audio` as `true`.","example":"ltx-2.5","uniqueKey":"model","typeLabel":"enum\u003cstring>"},"audio":{"type":"boolean","description":"Whether to include audio in the video. Defaults to `false` if not specified.\n\nAudio support varies by model:\n* **`gemini-omni-1.1`**: Not supported\n* **`kling-2.6`**: Not supported\n* **`kling-3.0`**: Toggle-able: audio adds extra credits when enabled\n* **`ltx-2.5`**: Toggle-able: no additional credits for audio\n* **`minimax-h3`**: Toggle-able: no additional credits for audio\n* **`seedance-1.5`**: Toggle-able: audio adds extra credits when enabled\n* **`seedance-2.0`**: Toggle-able: no additional credits for audio\n* **`seedance-2.0-fast`**: Toggle-able: no additional credits for audio\n* **`seedance-2.0-mini`**: Toggle-able: no additional credits for audio\n* **`seedance-2.5`**: Toggle-able: no additional credits for audio\n* **`veo3.1`**: Toggle-able: audio adds extra credits when enabled\n* **`veo3.1-lite`**: Toggle-able: audio adds extra credits when enabled\n* **`wan-2.2`**: Not supported\n* **`wan-3.0`**: Toggle-able: no additional credits for audio\n","example":true,"uniqueKey":"audio","typeLabel":"boolean"},"references":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z][\\w-]*$","example":"hero","isRequired":true,"uniqueKey":"references.items.[INDEX].name","typeLabel":"string"},"file_path":{"type":"string","minLength":1,"description":"This value is either\n- a direct URL to the file. The URL path must end in a supported file extension.\n- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).\n\nSee the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details.\n","example":"api-assets/id/1234.png","isRequired":true,"uniqueKey":"references.items.[INDEX].file_path","typeLabel":"string"}},"required":["name","file_path"],"uniqueKey":"references.items.[INDEX]","typeLabel":"object"},"minItems":1,"maxItems":10,"description":"Reference media for video generation. Name references without @ and refer to them as @name in style.prompt. Maximum 10 references total.\n\nSupported models and reference media:\n* **`gemini-omni-1.1`**: Supports images, videos. Up to 10 references.\n* **`kling-3.0`**: Supports images, videos.\n* **`minimax-h3`**: Supports images, videos, audio.\n* **`seedance-2.0`**: Supports images, videos, audio.\n* **`seedance-2.0-fast`**: Supports images, videos, audio.\n* **`seedance-2.0-mini`**: Supports images, videos, audio.\n* **`seedance-2.5`**: Supports images, videos, audio.\n* **`veo3.1`**: Supports images. Up to 3 references. Requires `end_seconds` of 8.\n* **`wan-3.0`**: Supports images, videos, audio.","uniqueKey":"references","typeLabel":"object[]"}},"required":["end_seconds","style"],"example":{"end_seconds":5,"aspect_ratio":"16:9","style":{"prompt":"a dog running"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"end_seconds":5,"aspect_ratio":"16:9","style":{"prompt":"a dog running"}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"6ffccff6-67d4-4a05-abf5-22c98482d331":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"cuid-example","description":"Unique ID of the video. Use it with the [Get video Project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch status and downloads.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"credits_charged":{"type":"integer","description":"The amount of credits deducted from your account to generate the video. If the status is not 'complete', this value is an estimate and may be adjusted upon completion based on the actual FPS of the output video. \n\nIf video generation fails, credits will be refunded, and this field will be updated to include the refund.","example":450,"isRequired":true,"uniqueKey":"credits_charged","typeLabel":"integer"}},"required":["id","credits_charged"],"description":"Success","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"cuid-example","credits_charged":450}}},"exampleType":"generated"}},"exampleType":"generated"},"99afefa6-d41c-445d-a547-4a607854f5fc":{"description":"Invalid Request","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_request"],"description":"Machine-readable error code.\n\n- `invalid_request`: Fix request syntax or validation errors before retrying.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"invalid_request","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"998ffb1a-76f3-4db1-800c-c4ba813b1232":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized"],"description":"Machine-readable error code.\n\n- `unauthorized`: Provide a valid API key before retrying.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"unauthorized","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"a03427ea-65f6-4770-ad24-8ee22f609043":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["insufficient_credits","subscription_required","plan_upgrade_required"],"description":"Machine-readable error code.\n\n- `insufficient_credits`: Purchase credits before retrying.\n\n- `subscription_required`: Start a subscription before retrying.\n\n- `plan_upgrade_required`: Upgrade the subscription plan before retrying.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"insufficient_credits","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"d2bdead2-1520-4d42-aad3-0944879b30a9":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["not_found"],"description":"Machine-readable error code.\n\n- `not_found`: Check the route or resource identifier.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"not_found","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"323255cc-044b-4b86-9d5c-b054ad7326be":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"Machine-readable error code.\n\n- `unprocessable_entity`: Change the request values before retrying.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"unprocessable_entity","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"ca22b456-5005-4ca4-9c51-4d485dea044a":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"Machine-readable error code.\n\n- `internal_server_error`: Retry later or contact support if the error continues.","isRequired":true,"uniqueKey":"code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"internal_server_error","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"c303e3a7-e91b-44e4-8c15-3edae2cf529e":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003capi_key>`, where `\u003capi_key>` is your API key. To get your API key, go to [Developer Hub](https://magichour.ai/developer?tab=api-keys\u0026utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=api-reference) and click \"Create new API Key\".","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"9d7d9813-e8f8-4d8d-bab1-aec4a4bedf19":{"url":"https://api.magichour.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003capi_key>`, where `\u003capi_key>` is your API key. To get your API key, go to [Developer Hub](https://magichour.ai/developer?tab=api-keys\u0026utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=api-reference) and click \"Create new API Key\".","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003capi_key>`, where `\u003capi_key>` is your API key. To get your API key, go to [Developer Hub](https://magichour.ai/developer?tab=api-keys\u0026utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=api-reference) and click \"Create new API Key\".","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"magichour","siteName":"Magic Hour API Docs","title":"Text-to-Video API Reference - Magic Hour Docs - Magic Hour API Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-29T16:10:45.589Z","originalFileLocation":"api-reference/video-projects/text-to-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=\"dark\"}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=\"What this API does Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. Good for - Automation and batch processing - Adding text to video into apps, pipelines, or tools How it works (3 steps) 1) Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path. 2) Send a request to create a text to video job with the basic fields. 3) Check the job status until it\u0026#x27;s complete, then download the result from downloads. Key options - Inputs: usually a file, sometimes a YouTube link, depending on project type - Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video. - Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt Cost Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded. For detailed examples, see the product page.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Magic Hour API Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_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/magichour/pV2W72GIHTaiOFzk/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Text-to-Video API Reference - Magic Hour Docs - Magic Hour API Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"What this API does Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. Good for - Automation and batch processing - Adding text to video into apps, pipelines, or tools How it works (3 steps) 1) Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path. 2) Send a request to create a text to video job with the basic fields. 3) Check the job status until it\u0026#x27;s complete, then download the result from downloads. Key options - Inputs: usually a file, sometimes a YouTube link, depending on project type - Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video. - Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt Cost Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded. For detailed examples, see the product page.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Magic Hour API Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.magichour.ai/api-reference/video-projects/text-to-video\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://d28dkohlqf5vwj.cloudfront.net/open-graph/logo-social-noisy-spectrum.jpg\">\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=\"Text-to-Video API Reference - Magic Hour Docs - Magic Hour API Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"What this API does Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. Good for - Automation and batch processing - Adding text to video into apps, pipelines, or tools How it works (3 steps) 1) Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path. 2) Send a request to create a text to video job with the basic fields. 3) Check the job status until it\u0026#x27;s complete, then download the result from downloads. Key options - Inputs: usually a file, sometimes a YouTube link, depending on project type - Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video. - Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt Cost Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded. For detailed examples, see the product page.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://d28dkohlqf5vwj.cloudfront.net/open-graph/logo-social-noisy-spectrum.jpg\">\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/magichour/pV2W72GIHTaiOFzk/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Magic Hour API Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3b82f6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.magichour.ai/api-reference/video-projects/text-to-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-projects/text-to-video.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.magichour.ai/#organization\",\"name\":\"Magic Hour API Docs\",\"url\":\"https://docs.magichour.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/magichour/5sgGJpuuipkw5s5v/icons/logo-light.svg?fit=max\u0026auto=format\u0026n=5sgGJpuuipkw5s5v\u0026q=85\u0026s=1f167e30baf11927bc2e0932411e455b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.magichour.ai#website\",\"name\":\"Magic Hour API Docs\",\"url\":\"https://docs.magichour.ai\",\"publisher\":{\"@id\":\"https://docs.magichour.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video#webpage\",\"url\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video\",\"name\":\"Text-to-Video API Reference - Magic Hour Docs\",\"description\":\"What this API does Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. Good for - Automation and batch processing - Adding text to video into apps, pipelines, or tools How it works (3 steps) 1) Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path. 2) Send a request to create a text to video job with the basic fields. 3) Check the job status until it's complete, then download the result from downloads. Key options - Inputs: usually a file, sometimes a YouTube link, depending on project type - Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video. - Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt Cost Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded. For detailed examples, see the product page.\",\"dateModified\":\"2026-10-29T16:10:45.589Z\",\"isPartOf\":{\"@id\":\"https://docs.magichour.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Video Projects\",\"item\":\"https://docs.magichour.ai/api-reference/video-projects/get-video-details\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text-to-Video API Reference - Magic Hour Docs\",\"item\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video#apireference\",\"headline\":\"Text-to-Video API Reference - Magic Hour Docs\",\"name\":\"Text-to-Video API Reference - Magic Hour Docs\",\"description\":\"What this API does Create the same Text To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow. Good for - Automation and batch processing - Adding text to video into apps, pipelines, or tools How it works (3 steps) 1) Upload your inputs (video, image, or audio) with Generate Upload URLs and copy the file_path. 2) Send a request to create a text to video job with the basic fields. 3) Check the job status until it's complete, then download the result from downloads. Key options - Inputs: usually a file, sometimes a YouTube link, depending on project type - Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video. - Extra fields: e.g. face_swap_mode, start_seconds/end_seconds, or a text prompt Cost Credits are charged when the job is queued (credits_charged in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded. For detailed examples, see the product page.\",\"url\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video\",\"mainEntityOfPage\":{\"@id\":\"https://docs.magichour.ai/api-reference/video-projects/text-to-video#webpage\"},\"image\":\"https://d28dkohlqf5vwj.cloudfront.net/open-graph/logo-social-noisy-spectrum.jpg\",\"dateModified\":\"2026-10-29T16:10:45.589Z\",\"publisher\":{\"@id\":\"https://docs.magichour.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.magichour.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Magic Hour API Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Magic Hour API Docs","nav":{"global":{"anchors":[{"anchor":"API quickstart","icon":"forward-fast","href":"/get-started/quick-start"},{"anchor":"API pricing","icon":"credit-card","href":"/billing/overview"},{"anchor":"Community","icon":"discord","href":"https://discord.com/invite/JX5rgsZaJp"},{"anchor":"Status","icon":"wave-pulse","href":"https://status.magichour.ai"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview"},{"title":"Models and Credit Costs","sidebarTitle":"Models","href":"/api-reference/models"},{"title":"Historical API Processing Times","sidebarTitle":"Processing Times","href":"/api-reference/processing-times"},{"group":"Account","pages":[{"openapi":"get /v1/account","title":"Get account details","href":"/api-reference/account/get-account-details"}]},{"group":"Files","pages":[{"openapi":"get /v1/saved-items","title":"List saved items","href":"/api-reference/files/list-saved-items"},{"openapi":"post /v1/files/upload-urls","title":"Generate Asset Upload Urls API Reference - Magic Hour Docs","sidebarTitle":"Generate Asset Upload Urls","href":"/api-reference/files/generate-asset-upload-urls"},{"openapi":"get /v1/face-detection/{id}","title":"Get Face Detection Details API Reference - Magic Hour Docs","sidebarTitle":"Get Face Detection Details","href":"/api-reference/files/get-face-detection-details"},{"openapi":"post /v1/face-detection","title":"Face Detection API Reference - Magic Hour Docs","sidebarTitle":"Face Detection","href":"/api-reference/files/face-detection"}]},{"group":"Video Projects","pages":[{"openapi":"get /v1/video-projects/{id}","title":"Get Video Details API Reference - Magic Hour Docs","sidebarTitle":"Get Video Details","href":"/api-reference/video-projects/get-video-details"},{"openapi":"delete /v1/video-projects/{id}","title":"Delete Video API Reference - Magic Hour Docs","sidebarTitle":"Delete Video","href":"/api-reference/video-projects/delete-video"},{"openapi":"post /v1/ai-talking-photo","title":"AI Talking Photo API Reference - Magic Hour Docs","sidebarTitle":"AI Talking Photo","href":"/api-reference/video-projects/ai-talking-photo"},{"openapi":"post /v1/ai-ugc-ad","title":"AI UGC Ad Generator","href":"/api-reference/video-projects/ai-ugc-ad-generator"},{"openapi":"post /v1/ai-video-editor","title":"AI Video Editor","href":"/api-reference/video-projects/ai-video-editor"},{"openapi":"post /v1/ai-video-translator","title":"AI Video Translator","href":"/api-reference/video-projects/ai-video-translator"},{"openapi":"post /v1/ai-video-upscaler","title":"AI Video Upscaler","href":"/api-reference/video-projects/ai-video-upscaler"},{"openapi":"post /v1/animation","title":"Animation API Reference - Magic Hour Docs","sidebarTitle":"Animation","href":"/api-reference/video-projects/animation"},{"openapi":"post /v1/audio-to-video","title":"Audio-to-Video","href":"/api-reference/video-projects/audio-to-video"},{"openapi":"post /v1/auto-subtitle-generator","title":"Auto Subtitle Generator API Reference - Magic Hour Docs","sidebarTitle":"Auto Subtitle Generator","href":"/api-reference/video-projects/auto-subtitle-generator"},{"openapi":"post /v1/character-replace","title":"Character Replace API Reference - Magic Hour Docs","sidebarTitle":"Character Replace","href":"/api-reference/video-projects/character-replace"},{"openapi":"post /v1/face-swap","title":"Face Swap Video API Reference - Magic Hour Docs","sidebarTitle":"Face Swap Video","href":"/api-reference/video-projects/face-swap-video"},{"openapi":"post /v1/image-to-video","title":"Image-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Image-to-Video","href":"/api-reference/video-projects/image-to-video"},{"openapi":"post /v1/lip-sync","title":"Lip Sync API Reference - Magic Hour Docs","sidebarTitle":"Lip Sync","description":"**What this API does**\n\nCreate the same Lip Sync you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding lip sync into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a lip sync job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/lip-sync).","href":"/api-reference/video-projects/lip-sync"},{"openapi":"post /v1/text-to-video","title":"Text-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Text-to-Video","href":"/api-reference/video-projects/text-to-video"},{"openapi":"post /v1/video-to-video","title":"Video-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Video-to-Video","description":"**What this API does**\n\nCreate the same Video To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding video to video into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a video to video job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/video-to-video).","href":"/api-reference/video-projects/video-to-video"}]},{"group":"Image Projects","pages":[{"openapi":"get /v1/image-projects/{id}","title":"Get Image Details API Reference - Magic Hour Docs","sidebarTitle":"Get Image Details","href":"/api-reference/image-projects/get-image-details"},{"openapi":"delete /v1/image-projects/{id}","title":"Delete Image API Reference - Magic Hour Docs","sidebarTitle":"Delete Image","href":"/api-reference/image-projects/delete-image"},{"openapi":"post /v1/ai-clothes-changer","title":"AI Clothes Changer API Reference - Magic Hour Docs","sidebarTitle":"AI Clothes Changer","href":"/api-reference/image-projects/ai-clothes-changer"},{"openapi":"post /v1/ai-face-editor","title":"AI Face Editor API Reference - Magic Hour Docs","sidebarTitle":"AI Face Editor","href":"/api-reference/image-projects/ai-face-editor"},{"openapi":"post /v1/ai-gif-generator","title":"AI GIF Generator API Reference - Magic Hour Docs","sidebarTitle":"AI GIF Generator","href":"/api-reference/image-projects/ai-gif-generator"},{"openapi":"post /v1/ai-image-editor","title":"AI Image Editor API Reference - Magic Hour Docs","sidebarTitle":"AI Image Editor","href":"/api-reference/image-projects/ai-image-editor"},{"openapi":"post /v1/ai-headshot-generator","title":"AI Headshot Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Headshot Generator","href":"/api-reference/image-projects/ai-headshot-generator"},{"openapi":"post /v1/ai-image-generator","title":"AI Image Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Image Generator","href":"/api-reference/image-projects/ai-image-generator"},{"openapi":"post /v1/ai-image-upscaler","title":"AI Image Upscaler API Reference - Magic Hour Docs","sidebarTitle":"AI Image Upscaler","href":"/api-reference/image-projects/ai-image-upscaler"},{"openapi":"post /v1/ai-meme-generator","title":"AI Meme Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Meme Generator","href":"/api-reference/image-projects/ai-meme-generator"},{"openapi":"post /v1/ai-qr-code-generator","title":"AI QR Code Generator API Reference - Magic Hour Docs","sidebarTitle":"AI QR Code Generator","href":"/api-reference/image-projects/ai-qr-code-generator"},{"openapi":"post /v1/body-swap","title":"Body Swap","href":"/api-reference/image-projects/body-swap"},{"openapi":"post /v1/face-swap-photo","title":"Face Swap Photo API Reference - Magic Hour Docs","sidebarTitle":"Face Swap Photo","href":"/api-reference/image-projects/face-swap-photo"},{"openapi":"post /v1/head-swap","title":"Head Swap API Reference - Magic Hour Docs","sidebarTitle":"Head Swap","href":"/api-reference/image-projects/head-swap"},{"openapi":"post /v1/image-background-remover","title":"Image Background Remover API Reference - Magic Hour Docs","sidebarTitle":"Image Background Remover","href":"/api-reference/image-projects/image-background-remover"},{"openapi":"post /v1/photo-colorizer","title":"Photo Colorizer API Reference - Magic Hour Docs","sidebarTitle":"Photo Colorizer","href":"/api-reference/image-projects/photo-colorizer"}]},{"group":"Audio Projects","pages":[{"openapi":"get /v1/audio-projects/{id}","title":"Get Audio Details API Reference - Magic Hour Docs","sidebarTitle":"Get Audio Details","href":"/api-reference/audio-projects/get-audio-details"},{"openapi":"delete /v1/audio-projects/{id}","title":"Delete Audio API Reference - Magic Hour Docs","sidebarTitle":"Delete Audio","href":"/api-reference/audio-projects/delete-audio"},{"openapi":"post /v1/ai-music-generator","title":"AI Music Generator","href":"/api-reference/audio-projects/ai-music-generator"},{"openapi":"post /v1/ai-voice-generator","title":"AI Voice Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Voice Generator","href":"/api-reference/audio-projects/ai-voice-generator"},{"openapi":"post /v1/ai-voice-cloner","title":"AI Voice Cloner API Reference - Magic Hour Docs","sidebarTitle":"AI Voice Cloner","href":"/api-reference/audio-projects/ai-voice-cloner"}]}],"groups":[{"group":"Account","pages":[{"openapi":"get /v1/account","title":"Get account details","href":"/api-reference/account/get-account-details"}]},{"group":"Files","pages":[{"openapi":"get /v1/saved-items","title":"List saved items","href":"/api-reference/files/list-saved-items"},{"openapi":"post /v1/files/upload-urls","title":"Generate Asset Upload Urls API Reference - Magic Hour Docs","sidebarTitle":"Generate Asset Upload Urls","href":"/api-reference/files/generate-asset-upload-urls"},{"openapi":"get /v1/face-detection/{id}","title":"Get Face Detection Details API Reference - Magic Hour Docs","sidebarTitle":"Get Face Detection Details","href":"/api-reference/files/get-face-detection-details"},{"openapi":"post /v1/face-detection","title":"Face Detection API Reference - Magic Hour Docs","sidebarTitle":"Face Detection","href":"/api-reference/files/face-detection"}]},{"group":"Video Projects","pages":[{"openapi":"get /v1/video-projects/{id}","title":"Get Video Details API Reference - Magic Hour Docs","sidebarTitle":"Get Video Details","href":"/api-reference/video-projects/get-video-details"},{"openapi":"delete /v1/video-projects/{id}","title":"Delete Video API Reference - Magic Hour Docs","sidebarTitle":"Delete Video","href":"/api-reference/video-projects/delete-video"},{"openapi":"post /v1/ai-talking-photo","title":"AI Talking Photo API Reference - Magic Hour Docs","sidebarTitle":"AI Talking Photo","href":"/api-reference/video-projects/ai-talking-photo"},{"openapi":"post /v1/ai-ugc-ad","title":"AI UGC Ad Generator","href":"/api-reference/video-projects/ai-ugc-ad-generator"},{"openapi":"post /v1/ai-video-editor","title":"AI Video Editor","href":"/api-reference/video-projects/ai-video-editor"},{"openapi":"post /v1/ai-video-translator","title":"AI Video Translator","href":"/api-reference/video-projects/ai-video-translator"},{"openapi":"post /v1/ai-video-upscaler","title":"AI Video Upscaler","href":"/api-reference/video-projects/ai-video-upscaler"},{"openapi":"post /v1/animation","title":"Animation API Reference - Magic Hour Docs","sidebarTitle":"Animation","href":"/api-reference/video-projects/animation"},{"openapi":"post /v1/audio-to-video","title":"Audio-to-Video","href":"/api-reference/video-projects/audio-to-video"},{"openapi":"post /v1/auto-subtitle-generator","title":"Auto Subtitle Generator API Reference - Magic Hour Docs","sidebarTitle":"Auto Subtitle Generator","href":"/api-reference/video-projects/auto-subtitle-generator"},{"openapi":"post /v1/character-replace","title":"Character Replace API Reference - Magic Hour Docs","sidebarTitle":"Character Replace","href":"/api-reference/video-projects/character-replace"},{"openapi":"post /v1/face-swap","title":"Face Swap Video API Reference - Magic Hour Docs","sidebarTitle":"Face Swap Video","href":"/api-reference/video-projects/face-swap-video"},{"openapi":"post /v1/image-to-video","title":"Image-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Image-to-Video","href":"/api-reference/video-projects/image-to-video"},{"openapi":"post /v1/lip-sync","title":"Lip Sync API Reference - Magic Hour Docs","sidebarTitle":"Lip Sync","description":"**What this API does**\n\nCreate the same Lip Sync you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding lip sync into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a lip sync job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/lip-sync).","href":"/api-reference/video-projects/lip-sync"},{"openapi":"post /v1/text-to-video","title":"Text-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Text-to-Video","href":"/api-reference/video-projects/text-to-video"},{"openapi":"post /v1/video-to-video","title":"Video-to-Video API Reference - Magic Hour Docs","sidebarTitle":"Video-to-Video","description":"**What this API does**\n\nCreate the same Video To Video you can make in the browser, but programmatically, so you can automate it, run it at scale, or connect it to your own app or workflow.\n \n**Good for**\n- Automation and batch processing \n- Adding video to video into apps, pipelines, or tools \n\n**How it works (3 steps)**\n1) Upload your inputs (video, image, or audio) with [Generate Upload URLs](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls) and copy the `file_path`. \n2) Send a request to create a video to video job with the basic fields. \n3) Check the job status until it's `complete`, then download the result from `downloads`.\n\n**Key options**\n- Inputs: usually a file, sometimes a YouTube link, depending on project type \n- Resolution: output size and plan requirements vary by workflow and model. Some workflows derive output size from the input video.\n- Extra fields: e.g. `face_swap_mode`, `start_seconds`/`end_seconds`, or a text prompt \n\n**Cost** \nCredits are charged when the job is queued (`credits_charged` in the response). Tools billed per frame charge an estimate and settle to the frames that actually render once the job finishes; tools billed per second charge the final amount upfront. Failed jobs are refunded.\n\nFor detailed examples, see the [product page](https://magichour.ai/products/video-to-video).","href":"/api-reference/video-projects/video-to-video"}]},{"group":"Image Projects","pages":[{"openapi":"get /v1/image-projects/{id}","title":"Get Image Details API Reference - Magic Hour Docs","sidebarTitle":"Get Image Details","href":"/api-reference/image-projects/get-image-details"},{"openapi":"delete /v1/image-projects/{id}","title":"Delete Image API Reference - Magic Hour Docs","sidebarTitle":"Delete Image","href":"/api-reference/image-projects/delete-image"},{"openapi":"post /v1/ai-clothes-changer","title":"AI Clothes Changer API Reference - Magic Hour Docs","sidebarTitle":"AI Clothes Changer","href":"/api-reference/image-projects/ai-clothes-changer"},{"openapi":"post /v1/ai-face-editor","title":"AI Face Editor API Reference - Magic Hour Docs","sidebarTitle":"AI Face Editor","href":"/api-reference/image-projects/ai-face-editor"},{"openapi":"post /v1/ai-gif-generator","title":"AI GIF Generator API Reference - Magic Hour Docs","sidebarTitle":"AI GIF Generator","href":"/api-reference/image-projects/ai-gif-generator"},{"openapi":"post /v1/ai-image-editor","title":"AI Image Editor API Reference - Magic Hour Docs","sidebarTitle":"AI Image Editor","href":"/api-reference/image-projects/ai-image-editor"},{"openapi":"post /v1/ai-headshot-generator","title":"AI Headshot Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Headshot Generator","href":"/api-reference/image-projects/ai-headshot-generator"},{"openapi":"post /v1/ai-image-generator","title":"AI Image Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Image Generator","href":"/api-reference/image-projects/ai-image-generator"},{"openapi":"post /v1/ai-image-upscaler","title":"AI Image Upscaler API Reference - Magic Hour Docs","sidebarTitle":"AI Image Upscaler","href":"/api-reference/image-projects/ai-image-upscaler"},{"openapi":"post /v1/ai-meme-generator","title":"AI Meme Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Meme Generator","href":"/api-reference/image-projects/ai-meme-generator"},{"openapi":"post /v1/ai-qr-code-generator","title":"AI QR Code Generator API Reference - Magic Hour Docs","sidebarTitle":"AI QR Code Generator","href":"/api-reference/image-projects/ai-qr-code-generator"},{"openapi":"post /v1/body-swap","title":"Body Swap","href":"/api-reference/image-projects/body-swap"},{"openapi":"post /v1/face-swap-photo","title":"Face Swap Photo API Reference - Magic Hour Docs","sidebarTitle":"Face Swap Photo","href":"/api-reference/image-projects/face-swap-photo"},{"openapi":"post /v1/head-swap","title":"Head Swap API Reference - Magic Hour Docs","sidebarTitle":"Head Swap","href":"/api-reference/image-projects/head-swap"},{"openapi":"post /v1/image-background-remover","title":"Image Background Remover API Reference - Magic Hour Docs","sidebarTitle":"Image Background Remover","href":"/api-reference/image-projects/image-background-remover"},{"openapi":"post /v1/photo-colorizer","title":"Photo Colorizer API Reference - Magic Hour Docs","sidebarTitle":"Photo Colorizer","href":"/api-reference/image-projects/photo-colorizer"}]},{"group":"Audio Projects","pages":[{"openapi":"get /v1/audio-projects/{id}","title":"Get Audio Details API Reference - Magic Hour Docs","sidebarTitle":"Get Audio Details","href":"/api-reference/audio-projects/get-audio-details"},{"openapi":"delete /v1/audio-projects/{id}","title":"Delete Audio API Reference - Magic Hour Docs","sidebarTitle":"Delete Audio","href":"/api-reference/audio-projects/delete-audio"},{"openapi":"post /v1/ai-music-generator","title":"AI Music Generator","href":"/api-reference/audio-projects/ai-music-generator"},{"openapi":"post /v1/ai-voice-cloner","title":"AI Voice Cloner API Reference - Magic Hour Docs","sidebarTitle":"AI Voice Cloner","href":"/api-reference/audio-projects/ai-voice-cloner"},{"openapi":"post /v1/ai-voice-generator","title":"AI Voice Generator API Reference - Magic Hour Docs","sidebarTitle":"AI Voice Generator","href":"/api-reference/audio-projects/ai-voice-generator"}]}]},{"tab":"Webhook Reference","pages":[{"title":"Webhook Reference","href":"/webhook-reference/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"title":"Text-to-Video API Reference - Magic Hour Docs - Magic Hour API Docs","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-26-lDe7V.js","utils-CWQmgYtH.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-4-Aw3rSD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C2zjXYA5.js","snippetPresets-DFmpFA7C.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-FJpQavWq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D_GvPF7k.js","shallow-Bs2ZB0NO.js","getApiPlaygroundDisplay-DCcqJJk-.js","CodeSnippet-DzDxawVe.js","CodeSnippets-aUr7fU-7.js","Page-CT9uE8Ip.js","getPastedJson-Y1fKsj_I.js","icon-DI4zTsDr.js","MethodPill-C0nDlmSQ.js","DuplicateIcon-NUXbx2nQ.js","createIcon-BdTHrPAi.js","DynamicMarkdown-CtpgKJwj.js","SectionHeading-B3x35tOt.js","axios-vUo_bRtp.js","Markdown-3OmurJMP.js","clsx-DMKzROTp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-1ms6tsT-.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ke9xIMFx.js"]}