We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

Video widget

Video widget code: how background video jobs reach your visitors

Video generation takes minutes, not seconds. This guide explains what happens behind the video widget code, from the first request to the finished clip, and what your visitors see along the way.

Published:

A chat answer streams in seconds. A generated video can take a few minutes. The video widget is built around that difference, so your visitors get a clear experience and your account stays protected while the job runs.

The same one line of code

Every widget type uses the same embed code:

<script src="https://api14.com/widget.js" data-widget="YOUR_WIDGET_ID" async></script>

The difference is on the server. When the widget type is Video, a visitor's prompt starts a job instead of returning a result right away.

Step by step

  1. The visitor submits a prompt. The request goes to api14 with your widget id. The server checks that the page is on one of your allowed sites, applies your limits and starts the job with the model you picked.
  2. A job id comes back. The widget shows a working state. The job id is tied to your widget: a different widget, or anyone guessing ids, cannot read it.
  3. The widget checks the status. Every few seconds it asks whether the video is ready. These checks are rate limited separately from new prompts, so a long job does not use up the visitor's request quota.
  4. The video plays. When the job is complete, the widget downloads the clip, plays it and shows a Download link.

If generation fails, the visitor sees your error message (or a neutral default), and the reason appears in your widget list so you can fix it.

What you control

  • The model: chosen in Widgets. The widget requests the supported duration closest to 5 seconds and the resolution closest to 720p, so cost per clip stays predictable.
  • The API key: every widget runs under one of your API keys, selected in the editor. The list ends with Create new API key. Jobs are recorded under that key and its limits apply.
  • The look: title, texts, accent color, theme, corner radius and placement. The widget is white label.

Your visitors never see the internals

The visitor only sees your texts, the progress state and the finished video. Your instructions, your balance, your API key and the provider's raw errors all stay on the server.

Monitoring

The widget list shows the last use, today's spend and the last error for each widget. Usage groups requests by widget or site, and failure emails tell you about problems you can fix, such as an empty balance or a removed model.

Learn more about video models in the video docs and build your widget on the widgets page.