# How to automate video creation with an API (REST and MCP)

If videos come from documents you already generate, such as product sheets, reports or course notes, the whole step can run without anyone opening an editor. Here is how to design that pipeline.

Developers · Updated 2026-11-20

## When automating video makes sense

Making one video by hand is fine. Making one for every new product, every weekly report, every lesson or every client is where manual work stops scaling. If the source material already exists as files, the video step is a good candidate for automation: the input is structured, the output is predictable, and the rules can be written down once.

Typical cases: an online store that wants a short video for each new product sheet, an agency producing weekly Reels from client briefs, a training team turning each module’s notes into an explainer, or an AI agent that drafts content and needs to deliver a finished MP4. The editorial principles do not change with automation; they are the same as in the [complete guide to turning a PDF into a video](https://abcontents.com/blog/pdf-to-video-guide). You just encode them in code.

Try one video by hand before you automate [Make my video](https://abcontents.com/create)

## REST for your code, MCP for AI agents

ABContents offers two ways in, both using the same prepaid key.

|  | REST API | MCP server |
| --- | --- | --- |
| Best for | Your backend, scripts, scheduled jobs | AI agents and MCP clients |
| How you order | POST /api/v1/videos as a multipart form with files, logo, style, voice and length | The agent calls tools such as create_video |
| Price check | Quote before ordering | get_quote |
| Progress | Poll the order for step, progress and seconds left | get_video |
| Styles | Choose one of 20 | list_styles |

Point an MCP client at /api/mcp with your key in the Authorization header and the agent can check the price, pick a style, order the video and poll it until the MP4 link is ready. The full reference is on [API access](https://abcontents.com/api-access) and the [video API for AI agents](https://abcontents.com/video-api-for-ai-agents) page.

## Design the pipeline

A reliable video pipeline has the same steps whatever triggers it:

1. Trigger: a new file in a folder, a product published in your catalog, a form submission or an agent’s decision.
2. Prepare input: pick the files (up to 9) and write a short brief from a template, for example “Marketing video for {product}, for {audience}, end with: buy at {url}.”
3. Quote: get the price before ordering, and stop if it is above the budget you set for that job.
4. Order: send the files, brief, style, voice, music and length; store the returned order id.
5. Poll: check progress at a sensible interval; the response includes seconds left, queue included.
6. Deliver: download the MP4 from the direct link, which is kept for 30 days, and copy it to your own storage.

Store the order id with your source record, so you can always trace which video came from which document. Keep the brief templates in version control; they are the part you will tune most.

Handle the unhappy paths from day one. Retry network errors with a backoff instead of re-sending an order you are not sure went through: check the order id first. Log every quote next to the job, so a sudden cost jump (a template that asks for 5 minutes instead of 1, for example) shows up before the balance runs out. The balance endpoint lets a scheduled job warn you when it is time to top up the key.

## Costs, limits and human review

Keys are prepaid with no account, no user and no password: 25 tokens for USD 25, 100 for USD 90 or 500 for USD 400, and you can top up the same key. One token is USD 1 of video, with the same price rules as the web: 2D costs 1 token plus 2 per minute, 3D costs 1 plus 3 per minute, minimum 3. Tokens from failed videos go back to the key, so a failed render does not burn budget.

Be clear about the limits before you build. Output is MP4, vertical 9:16 by default or 4:5, 1:1 and 16:9 with the format field, from 30 seconds to 5 minutes, in English or Spanish. The script is written only from the files and brief you send, so poor input gives a thin video. And automation should not mean publishing blind: for anything customer-facing, add a review step where a person watches the video and checks names, prices and claims before it goes live.

## Start small

Choose the first case by volume and risk: something you make often, from clean source files, where a slightly imperfect video does no harm. Internal training clips or product explainers are good candidates; legal, medical or financial claims are not, at least not without careful review.

Before wiring anything, make one video by hand on [/create](https://abcontents.com/create) with a real document from your pipeline. It shows you what a good brief looks like and which style and voice fit. Then automate that exact case, with a small pack, and grow from there. If you are deciding between occasional manual videos and a key, [pay per video](https://abcontents.com/pay-per-video-ai-generator) explains the per-order option.

## Questions

### Do I need an account to use the ABContents API?

No. You buy a prepaid pack and get a key: 25 tokens for USD 25, 100 for USD 90 or 500 for USD 400. There is no user or password.

### Can an AI agent order videos by itself?

Yes. The MCP server at /api/mcp exposes tools such as create_video, get_video, get_quote and list_styles, so an agent can quote, order and poll a video.

### What happens if a video fails?

The tokens from failed videos go back to your key automatically.

### Which formats can the API produce?

Vertical 9:16 MP4 at 1080x1920, from 30 seconds to 5 minutes, narrated in English or Spanish. Send format=4:5, 1:1 or 16:9 for other sizes.

## Use cases

- [Video API for AI agents: MCP server and REST, pay per video](https://abcontents.com/video-api-for-ai-agents)
- [AI video generator with no subscription: pay per video](https://abcontents.com/pay-per-video-ai-generator)
- [PDF to video AI: your document, narrated and animated](https://abcontents.com/pdf-to-video)
