Guide9 min readAug 24, 2026

Video generation API: create videos programmatically

Text has had APIs forever. Images got them in 2022. Video is the last medium you still can't reliably produce with a POST request — most "video APIs" either render rigid templates or return raw AI footage with no voiceover, no structure, and no brand. A video generation API in the useful sense takes a prompt or a document and returns a finished, branded, narrated video your code can ship to a user. This guide covers what that unlocks, four things developers are building with it, and a six-step quickstart against Ozor's REST API — with real endpoints from the developer docs, not pseudocode.

Quick Answer

A video generation API lets your code create finished videos from a text prompt or document. With Ozor: create an API key in the dashboard, POST a prompt to /api/v1/videos/generate with an X-API-Key header, poll the returned job until it completes, then export an MP4 at up to 4K with a permanent share link. Generation costs one credit; the free plan includes 10 credits, and paid plans start at $19/mo for 50.

What is a video generation API?

A video generation API is a programmatic interface that turns structured input — a text prompt, a document, a data payload — into a finished video file, without a human opening an editor. The request describes what the video should say; the service handles scene design, motion, voiceover, music, and rendering; the response hands your code an MP4 and a shareable URL.

The category hides three very different architectures. Template-rendering APIs (the Shotstack model) let you programmatically fill and render layouts you designed in advance — predictable, but every output is the same video with different values. Generative-clip APIs return short raw AI footage — impressive frames, but no narration, no information structure, and heavy post-production before anything is shippable. AI-agent APIs, the model Ozor uses, sit between: an agent interprets your prompt, designs animated motion-graphics scenes around your actual content, writes and records the voiceover, applies your brand kit, and renders the result. You get the flexibility of generation with the finish of production.

Ozor exposes that engine three ways, all sharing one credit balance and one auth model: a keyed REST API under /api/v1/ for code, an official n8n node for no-code workflow automation, and an MCP server for AI agents. This guide covers the REST surface — the right layer when video generation is embedded in your product or pipeline and you want request-level control.

What you can build with one

The pattern behind every good API use case is the same: you have structured data that would land better as a video, and the volume or freshness requirement makes manual production impossible. Four builds that fit:

  • In-product video features.Your users have content — reports, listings, lessons, portfolios — and you want a "Turn this into a video" button next to it. Your backend maps the user's data into a prompt, calls generate, polls the job, and surfaces the share link or embed in your own UI. Video generation becomes a feature of your product without your team building a rendering pipeline, and the free export step means you only spend credits when a user actually generates.
  • Personalized video at scale.One generate call per record: loop over your leads, customers, or students, inject each record's name, company, and context into the prompt, and produce a genuinely different video per person — not a template with a name swap, because the agent designs scenes around the specific context you pass. This is the engine behind personalized sales videos at scale, and at one credit per video the unit economics work at list size.
  • CI-triggered changelog videos.A release pipeline step collects merged PR titles and release notes, concatenates them into a prompt, and generates a 60-second "what shipped this week" video — posted to Slack or your changelog page by the same job that cut the release. Product updates people actually watch, produced by the deploy itself, with zero human minutes per release.
  • Marketplaces generating listing videos. Every new listing — property, job, product, course — triggers a generate call with the listing's attributes and photos (the API accepts image attachments by URL). Listings with video convert better, but no marketplace can staff video production per listing; an API call per insert can. Public exports return a permanent share URL, so the video lives on the listing page for its lifetime.
  • Document pipelines.The API's document endpoints analyze a PDF, DOCX, PPTX, or URL into an editable scene plan your code can adjust before rendering — the programmatic version of document to video AI. Point it at your knowledge base and every article gains a video counterpart.

Ozor AI

Video, one POST request away

Create an API key, send a prompt, get a finished branded video back. 10 free credits to start.

Try Ozor Free

Quickstart: Ozor's API in six steps

The full reference lives in the developer docs; this is the shortest path from nothing to a shareable video URL. Everything below is plain HTTPS with JSON bodies — no SDK required.

1

Create an API key

Sign in at ozor.ai and open Settings → Developer → API Keys. Create a key and name it after its environment — 'production', 'staging', 'ci' — so you can revoke each independently later. Keys look like sk_live_ followed by 32 hex characters, and the raw key is shown exactly once at creation time; Ozor stores only a SHA-256 hash, so copy it into your secret manager immediately. Accounts can hold up to 5 active keys. Every request to the public API authenticates with a single header: X-API-Key: sk_live_...

2

Send your first generate request

POST /api/v1/videos/generate takes a natural-language prompt (1 to 2,000 characters) and an optional aspect of '16:9' or '9:16'. This is the core difference from template-rendering APIs: you are not filling slots in a fixed layout, you are describing the video you want, and the AI agent designs the scenes, writes the voiceover, and applies your brand styling. The call is asynchronous — it returns immediately with a videoId for the new project and a jobId for the agent run. Pass export: true if you want an MP4 render triggered automatically the moment the agent finishes.

3

Poll the job until it completes

Poll GET /api/v1/videos/{videoId}/jobs/{jobId} until status is 'completed'. A sensible cadence is 2 to 3 seconds for the first minute and 5 to 10 seconds after that; typical generations finish in tens of seconds to a few minutes depending on prompt complexity. The completed response includes the agent's text reply describing what it built. One credit is deducted on successful completion — never on failure, and failed jobs return a status of 'failed' with an error field you can log and retry on.

4

Iterate with a follow-up message

The first draft is rarely the final cut, so the API keeps the conversation open. POST /api/v1/videos/{videoId}/message sends a natural-language edit instruction to the same agent — 'Make the intro punchier and add our logo to every scene' — and returns a new jobId to poll exactly like the generate job. You can attach images (by URL or base64) to give the agent visual reference material. Each message costs one credit on success, and you can send as many rounds as it takes to get the video right before you ever render an MP4.

5

Export the MP4

POST /api/v1/videos/{videoId}/export triggers the render. Pass quality ('720p', '1080p', or '4k') and isPublic: true if you want a permanent share link. Exports are free — credits are only spent on generation and edits — so rendering at multiple qualities costs nothing extra, and identical exports are served from cache instantly. Then poll GET /api/v1/videos/{videoId} until exportStatus is 'complete'. If you passed export: true back in step 2, this render already happened automatically and you can skip straight to polling.

6

Embed, share, or download

The completed video object gives you three handles. downloadUrl is a signed URL valid for roughly 24 hours — re-fetch the endpoint whenever you need a fresh one, or pull the file into your own storage. For public exports, shareUrl and shareCode are permanent: link the hosted watch page directly, or drop the video into your product with an iframe pointed at ozor.ai/embed/{shareCode}. There is also an editorUrl on every video, so a human can always open the project in the Ozor editor and take over from where your code left off.

The fastest variant collapses steps 2, 5, and 6 into a single call by auto-exporting:

curl -X POST https://ozor.ai/api/v1/videos/generate \
  -H "X-API-Key: $OZOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A 30-second onboarding video for our analytics dashboard",
    "aspect": "16:9",
    "export": true,
    "exportQuality": "1080p",
    "exportIsPublic": true
  }'
# -> { "videoId": "abc123", "jobId": "job_...", "status": "pending" }

Then one polling loop against the video resource covers both the agent run and the render:

curl https://ozor.ai/api/v1/videos/abc123 \
  -H "X-API-Key: $OZOR_API_KEY"
# poll every 2-3s; when "exportStatus" is "complete":
# -> { "shareUrl": "...", "shareCode": "a3kf92p",
#      "downloadUrl": "...", "thumbnailUrl": "..." }

Two error codes are worth handling explicitly: 402 means your credit balance is short for the operation (no partial work happens, nothing is deducted), and 401 means the key is missing or revoked. Everything else returns JSON with a detail field explaining what went wrong.

Ozor API vs the alternatives

"Video API" covers several products that are not actually interchangeable. Here is how the realistic options compare on the dimensions that decide an integration:

OptionOutput typePricing modelVoiceover includedDifficulty
Ozor APIAnimated motion-graphics video, 16:9 or 9:16Credits — free tier, plans from $19/moYes — AI voiceover and music built inLow — one POST, one polling loop
Synthesia APIAI avatar presenter videosSubscription; API typically on higher tiersYes — avatar speech from a scriptLow to medium — script and scene setup
ShotstackTemplate-based edits and rendersUsage-based, per renderNo — bring your own audioMedium — JSON edit timelines to author
DIY ffmpeg pipelineWhatever you engineerInfrastructure plus engineering timeNo — integrate a separate TTS serviceHigh — weeks of build and maintenance

The decision usually reduces to output type. Avatar APIs are the right call when you specifically want a presenter on screen reading a script. Template renderers are right when your videos genuinely are the same layout with different values and you have a designer to build the templates. A DIY ffmpeg pipeline gives you total control at the cost of owning composition, TTS integration, rendering infrastructure, and every edge case forever.

Ozor's API is built for the case in between: explainer-style animated video where the content changes per request and the result needs voiceover, music, and brand styling without post-production. The conversational message endpoint is the part the other models lack — your code (or an agent, or a human in the editor) can iterate on a draft instead of regenerating from scratch. For how the underlying engine stacks up against the broader generation landscape, see the best AI video generator comparison; for current plan details, see pricing.

Frequently asked questions

How does authentication work?

Every public endpoint lives under /api/v1/* and requires an X-API-Key header with a key in the format sk_live_ followed by 32 hex characters. Keys are created in the Ozor dashboard under Settings → Developer → API Keys (or programmatically via the key-management endpoints, which use your session token instead). The raw key is shown once at creation — Ozor stores only a SHA-256 hash — and you can hold up to 5 active keys per account, revocable independently and effective immediately.

How is the API priced?

By credits, shared with the Ozor app: one credit per video generation, one credit per edit message, and exports are free at any quality. Credits are only deducted on successful completion — a failed job costs nothing. The free plan includes 10 credits with 720p exports; Pro ($19/mo) includes 50 credits, Pro+ ($49/mo) includes 150, and Business ($99/mo) includes 300, all with exports up to 4K. There is no separate API pricing tier and no rate limiting — usage is governed entirely by your credit balance, and an insufficient balance returns a clean 402.

How long does a generation take?

Typical end-to-end time — agent generation plus MP4 export — ranges from tens of seconds to a few minutes, depending on prompt complexity and export quality. The recommended polling cadence is 2 to 3 seconds between requests for the first minute, then 5 to 10 seconds after that. Because generation and export are separate steps, you can also generate once, iterate with edit messages until the draft is right, and only pay the render time at the end.

What output formats does the API return?

MP4 renders at 720p, 1080p, or 4K, in 16:9 landscape or 9:16 portrait, with AI voiceover, music, and brand styling already baked in — there is no separate audio pipeline to wire up. Completed exports expose a downloadUrl (a signed URL valid about 24 hours; re-fetch the video endpoint for a fresh one) and, for public exports, a permanent shareUrl and shareCode you can use for hosted watch pages and iframe embeds.

Does the API support webhooks, or do I poll?

Polling is the supported pattern today; there is no 'export complete' webhook yet. In practice this is two simple loops: GET /api/v1/videos/{videoId}/jobs/{jobId} while the agent works, and GET /api/v1/videos/{videoId} while an export renders. If you would rather not write the loop at all, the official n8n node and the MCP server both wrap the same API with built-in waiting — the n8n node has a 'Wait for completion' toggle and MCP exposes wait_for_job and wait_for_export tools.

Can I use API-generated videos commercially?

Yes. Videos you generate belong to you and can be used commercially — in your product, in customer communication, in marketing. Paid plans export watermark-appropriate quality up to 4K, and public share links are permanent, so links you embed in a product or send to a customer keep working. The API surface is the same engine as the Ozor app, so anything generated programmatically can also be opened and refined by a teammate in the editor.

Ozor AI

Ship your first generated video today

10 free credits, no card. Create a key, POST a prompt, and hold a share URL ten minutes from now.

Try Ozor Free

Written by Mintii Labs · Ozor founders · Aug 24, 2026