To generate TikTok, YouTube Shorts and Instagram Reels videos automatically, describe the video once as a JSON template and send one API request per video. Each request carries the script, the clips or images and the style choices. JSON2Video renders a 9:16 MP4 in the cloud with an AI voice-over, word-by-word captions and music, and calls your webhook when it is ready. A workflow in n8n, Make or your own code then posts it.
JSON2Video assembles the video; it does not invent the footage. The b-roll comes from stock libraries, from your own media, or from AI video models that you call separately, and this page shows how each fits. It also says what JSON2Video does not do: it does not pick the best moments of a long video, and it does not publish to TikTok, YouTube or Instagram by itself.
How do I automatically generate TikTok and YouTube Shorts videos with an API?
Send the script and the clips to POST /v2/movies with "resolution": "instagram-story", which is 1080×1920 (9:16) and is the format TikTok, Shorts and Reels all use. Rendering is asynchronous: the response returns a project ID immediately and a webhook delivers the MP4 URL when the render finishes.
This movie turns a list of lines and clips into a vertical video. Each scene plays a clip, muted and cropped to fill the screen, with an AI voice-over reading the line and captions that highlight each word. Quiet music plays under everything. The clip URLs are samples on our CDN:
{
"resolution": "instagram-story",
"variables": {
"scenes": [
{ "clip": "https://assets.json2video.com/assets/videos/beach-01.mp4",
"line": "The ocean covers most of our planet." },
{ "clip": "https://assets.json2video.com/assets/videos/new-york-01.mp4",
"line": "Cities grew up along its coasts." }
]
},
"elements": [
{ "type": "audio", "src": "https://cdn.json2video.com/assets/audios/uplifting-cinematic.mp3", "volume": 0.2 }
],
"scenes": [
{
"duration": 6,
"iterate": "scenes",
"transition": { "style": "fade", "duration": 0.3 },
"elements": [
{ "type": "video", "src": "{{clip}}", "resize": "cover", "position": "center-center",
"muted": true, "duration": -2 },
{ "type": "voice", "text": "{{line}}", "voice": "en-US-EmmaMultilingualNeural" },
{ "type": "subtitles",
"settings": { "style": "classic-progressive", "position": "bottom-center",
"max-words-per-line": 3, "all-caps": true, "font-size": 70,
"line-color": "white", "word-color": "#FF6B00",
"outline-color": "black", "outline-width": 4 } }
]
}
],
"exports": [
{ "destinations": [ { "type": "webhook", "endpoint": "https://example.com/webhook" } ] }
],
"client-data": { "episode": "ocean-001" }
}
curl -X POST https://api.json2video.com/v2/movies \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d @short.json
Notes on the example:
iteraterepeats the scene once per item of thescenesarray, so a 5-scene Short and a 12-scene Short use the same template. The scene is fixed at 6 seconds here; leave outdurationand each scene lasts as long as its longest element instead.resize: "cover"withposition: "center-center"fills the vertical frame from a landscape clip by cropping evenly on both sides.muted: truesilences the clip's own sound so the voice-over and music are what you hear.- The
subtitleselement transcribes the voice-over automatically, so the captions always match the narration. Word-by-word styles are the usual look for Shorts and Reels. client-datacomes back in the webhook, so you know which video belongs to which record. Webhook details are in the webhooks reference.
A longer example with quick cuts, on-screen text and music is the social reel guide; the captions are covered in automatic subtitles, and the voices in AI voice-over.
Try it with a free API key
A free account includes 600 credits (10 minutes of video), no credit card. Free-plan videos are watermarked, up to 60 seconds, and for evaluation only. Get your free API key →
Where the footage comes from (b-roll)
A video needs footage. There are three sources, and you can mix them in one video: stock footage, AI-generated clips from a video model, and your own media. Whichever you choose, each clip is a URL in a video element (or a picture URL in an image element), and JSON2Video adds the voice-over, captions, music, text and branding and renders the final video.
| Source | How it gets into the video | Cost | Watch out for |
|---|---|---|---|
| Stock footage | Pick clips in the visual editor's media browser, or fetch a clip URL from a stock provider in your own workflow and put it in the src field. |
Set by the stock provider. | The stock licence still applies to the finished video: check that it covers your use. The same clip appears in other people's videos. |
| AI-generated clips | Generate a short clip from a prompt or an image with a video model, store it, and use its URL as the src. |
Charged per second of clip by the model's provider. Compare them in the video model price comparator. | Generator links expire, so copy the clip to your own storage first. Clips are short, so a scene may need several. |
| Your own media | A public URL, a file in your account's media library, or a Google Drive or Dropbox link set to public access. | Free. | Make sure you hold the rights, especially for footage or music taken from other people's videos. |
What kinds of APIs let video editing apps generate original b-roll from a script?
Two kinds work together: a video generation API that turns a prompt (text-to-video) or a starting image (image-to-video) into a short clip, and an assembly API such as JSON2Video that places the clips on a timeline with the narration. A language model usually writes one prompt per scene from the script. The generation API makes the footage; JSON2Video does not. For what each generation API charges per second and what each model can do, use the video model comparator, and read video generation APIs for how the jobs work.
Which generative video APIs suit editors who need supplemental b-roll?
Look at four things: price per second, clip length, whether it takes a starting image (so the clip matches your brand or product), and how long the result stays available. The comparator shows them side by side. Because the footage ends up as a URL, you can switch generation provider without changing the video template.
Can I use AI-generated images instead of clips?
Yes. An image element can ask for a generated picture with a model and a prompt, and a zoom and pan on it gives it motion. Image models are much cheaper than video models; see AI generation pricing for the credits per image.
How do I automate a faceless channel with AI?
Chain four steps: an AI step writes the script, JSON2Video turns it into a video with a voice-over and b-roll, a webhook receives the MP4, and a publishing step posts it. The result is a channel with no one on camera and no manual editing, running on a schedule or on new rows in a sheet.
- Idea and script. A row in a Google Sheet or a table with the topic, or a language model that writes the lines for each scene.
- B-roll. One clip or image per scene: stock, AI-generated or your own library (see above).
- Render.
POST /v2/movieswith the template and the scenes as variables. The voice (Azure or ElevenLabs text-to-speech) and the captions are generated during the render, at 0 credits for the voice and the captions; the video costs 1 credit per second. - Webhook. The workflow receives the video URL and your
client-data. - Publish. Post the file with the platform's own API or a ready-made node or module in n8n or Make. JSON2Video delivers the MP4 to a webhook, FTP, SFTP, email or Amazon S3 but does not post to social platforms itself.
Follow a worked example in the n8n tutorials or the Make.com tutorials, import a starter kit (one row, one video), or let Automations in the dashboard render one video per row without any external tool. Check each platform's rules on automated and AI-generated content before you publish at volume.
Are there AI video tools with an API for automated video creation at scale for the creator economy?
Yes, in two layers. AI generation APIs create footage from prompts; assembly APIs such as JSON2Video turn footage, scripts and data into finished, branded videos in bulk. For volume, the assembly layer matters most, because it is what makes every video complete, on brand and ready to post.
- Cost per video: 1 credit per second of output at any resolution; failed renders are not billed. A 30-second Short is 30 credits, about $0.125 on the Professional plan ($49.95 for 12,000 credits), so that plan covers 400 such videos a month. AI-generated clips from other providers are billed by them.
- Parallel by design: each request is a job, renders run in parallel in the cloud, and a webhook announces each result. Spread a very large batch out and, for a launch far above your normal volume, tell us in advance.
- Templates keep the look: the template fixes fonts, caption style, colors, music and logo, so a hundred videos look like one channel. See programmatic video for the limits to design around (request size, video length, file retention).
- Voices and languages: swap the text and the voice per locale to publish the same video in several languages.
Which AI video APIs resize one clip into 9:16, 16:9 and 1:1 versions in one pipeline?
With JSON2Video you render the same template three times with a different resolution, and resize fits the clip to each canvas. The presets are instagram-story (1080×1920, 9:16), full-hd (1920×1080, 16:9) and squared (1080×1080, 1:1). Each render is a separate request billed by its length.
| Platform use | Ratio | Preset | Size |
|---|---|---|---|
| TikTok, YouTube Shorts, Instagram Reels and Stories | 9:16 | instagram-story | 1080×1920 |
| YouTube, websites | 16:9 | full-hd | 1920×1080 |
| Feed posts (Instagram, Facebook, LinkedIn) | 1:1 | squared | 1080×1080 |
With resize: "cover" the clip fills the frame and its edges are cropped; with "contain" the whole clip stays visible and the rest of the frame shows the background. A scene laid out for 9:16 will not automatically look right at 16:9, so keep one template per format and test both. When you save the video as a template, the request can override resolution, quality, exports and client-data without touching the template.
Which APIs give progress updates before the final render?
JSON2Video reports the state of a render, not a percentage. GET /v2/movies?project=ID returns pending (queued), running or done with the video URL, or error with the reason, and a webhook announces the result without polling. If you poll, wait at least 5 seconds between checks.
For an app where a user waits for a video, show your own steps (script written, voice generated, rendering) and use the states above for the last one. To give users a fast first look, render with "quality": "low", which renders faster at the same credit cost, and render the final version at high when they approve. See optimization and cost.
How can I automate extracting the best 60 seconds of a YouTube video and publishing it to TikTok?
JSON2Video does not find the best moments, and it does not download YouTube videos. What it does is take a segment you have chosen and prepare it for TikTok: you give the source file's URL, a start time and a length, and it reframes the clip to 9:16, adds captions and a title, and renders it.
- Cut a segment: on the
videoelement,seeksets where in the source to start (in seconds) anddurationsets how long to play. - Reframe:
resize: "cover"withposition: "center-center"fills the vertical frame. - Captions: a
subtitleselement transcribes the audio of the scene automatically. - The choice of the best 60 seconds is a separate step, for example a language model that reads the transcript and returns start and end times, which your workflow then sends to JSON2Video.
Only automate this with video you own or have the rights to reuse.
Which text-to-video APIs suit developers adding clip creation to social apps?
If the user types a prompt and expects a generated shot, you need a text-to-video generation API; compare them in the video model comparator. If the user supplies photos, clips, text or activity data and expects a finished video, you need an assembly API. Many apps combine both: the generator makes the clip, JSON2Video adds the user's name or stats, the voice, captions and your branding, and your backend stores the result.
For personalized videos from user activity, put the data in template variables (a name, a number, a result, a photo) and send one render per user. Rendered files are kept for 7 days, so copy them to your own storage or let JSON2Video deliver them to Amazon S3, FTP or SFTP. See programmatic video.
Frequently asked questions
What resolution should I use for TikTok, YouTube Shorts and Reels?
The instagram-story preset: 1080×1920, 9:16. It is the same vertical format on all three platforms, so one render can be posted to each.
Does JSON2Video publish to TikTok, YouTube or Instagram?
No. It renders the MP4 and delivers it to a webhook, FTP, SFTP, email or Amazon S3. Posting is done by your workflow (n8n, Make or your own code) with the platform's API.
Where does the b-roll come from?
From stock libraries, AI video models, or your own media. Each clip is a URL in a video element. JSON2Video does not generate the footage; it adds voice-over, captions, music and branding and renders the final video.
Can I add AI voice-over and captions automatically?
Yes. A voice element turns text into speech with Azure or ElevenLabs voices, and a subtitles element transcribes the audio into styled, word-by-word captions. Both cost 0 credits today; you pay only for the rendering, 1 credit per second.
How much does a Short cost to generate?
1 credit per second of video, so a 30-second Short is 30 credits, about $0.125 on the Professional plan ($49.95 for 12,000 credits). Failed renders are free. AI-generated clips are billed separately by their provider.
Can I make the same video in several languages?
Yes. Put the text and the voice in variables and render once per language. Each language is a separate render.
Can I use the free plan for my channel?
For testing only. Free-plan videos can be watermarked, up to 60 seconds long, and are for non-commercial use. Paid plans render without a watermark and allow commercial use.
How do I know when a video is ready?
Add a webhook destination to the movie, or poll GET /v2/movies?project=ID no more often than every 5 seconds. The status moves from pending to running to done; there is no percentage.
Ready to build it? Get a free API key, browse the video templates, or read the documentation. For the general pattern, see how to automate video creation with an API.
Published on November 29th, 2026