Personalized Video AI at Scale: Faces With Consent
Personalized video AI with consent: each customer's own face in one template clip by API, with opt-in records, batches, delivery and cost per video.
Updated 6 min read
Personalized video AI at scale starts from one template clip and ends with a copy for each customer, their own face on the person in it. By API, that is one request per customer to Frameport Replace 1: the template's moves, lips, scene and sound stay, the face becomes the one the customer sent, and each video costs the template's seconds at $0.12 per second at 768p, charged only when it comes out.
Consent is the first step, not a footnote: only faces their owners sent you for this purpose. This guide covers what to record, the template clip, batches that stay inside the limits, delivery by webhook, and the cost per video.
What personalized video AI means here
- One clip for everyone. You film or generate a single template: a presenter who waves, a toast at a table, a walk through a shop.
- One face per customer. Each customer sends a photo of their face, and the edit puts it on the person in the template.
- Words on screen are yours to add. A first name, an order number or a date go on top afterwards, with your own tools: the edit changes faces, it does not write text into the picture.
- The sound is the template's. Nobody is made to say a customer's name: the audio stays as it was recorded or generated.
Typical uses are thank-you clips after an order, team and event videos, onboarding greetings, and campaigns where fans opt in to appear in a brand's clip.
Consent first: collect it, record it, honor a withdrawal
- Opt in, never by default. The customer uploads their own photo after a plain sentence that says what will be made with it, where it will appear and for how long.
- Keep a record of who agreed, to which wording, when, and for which campaign.
- Only the face the customer sent. Never a profile picture lifted from a social network, never a photo of someone else.
- Nobody under age. Nothing involving minors is ever allowed, so check that every participant is of age before they can take part.
- Withdrawal. When a customer changes their mind, delete their photo and video from your storage and stop using them. On our side,
DELETE /v1/uploads/{id}stops an upload at once (do it after the edit has settled, since a running edit may still read it), and generated files are not kept forever.
The acceptable use policy makes you answerable for what people generate through your keys, and it never allows a real, identifiable person without their consent, impersonation or fraud. A request we turn down returns content_policy and is free.
One template clip, many faces
A template swaps well when it is one continuous shot of 2 to 10 seconds, at 24 fps, as MP4 or MOV up to 64 MB, with the person facing the camera in even light. Film it with someone who agreed to the use, or generate it. A clip made with Frameport Motion 1 gives you a fictional presenter, with sound, in the shape you post:
{
"model": "fp-motion-1",
"prompt": "A friendly presenter in a navy polo shirt stands in a bright shop, looks into the camera, smiles and waves, steady medium shot, soft shop ambience",
"duration": 8,
"resolution": "768p",
"aspect_ratio": "9:16",
"audio": true
}That template costs $0.48, once. Check its frame rate before you use it, since the editor takes 24 fps only, and convert it with ffmpeg if needed. Then keep it on your own storage behind a public https URL, or upload it once per batch: an upload id works for 24 hours (uploads).
Each customer's request is then the same body with a different face:
{
"model": "fp-replace-1",
"video": "https://cdn.example.com/campaigns/winter/template.mp4",
"faces": ["https://storage.example.com/faces/c-8412.jpg"],
"resolution": "768p",
"max_cost_usd": 1.2
}keep_outfitstaystrue, the default, so every customer wears the template's clothes: a uniform, a branded shirt.- A template with one person needs no
targets. One with two people takes two faces and two targets, say a customer and a friend who both agreed: the multiple face swap guide shows how to write them. max_cost_usdis checked against the hold, the price of the longest clip the editor takes, so set it at that price or above: a lower cap refuses every edit before it starts.
The edits reference lists what a clip and a face may be.
Batches that stay inside the workspace limits
| What | Limit | Past it |
|---|---|---|
| Requests that start work | 60 a minute | 429 rate_limited |
| Edits running at once | 20 | 429 concurrency_limit |
| Uploads | 10 a minute, 100 held | 429 rate_limited, 409 conflict |
Both kinds of 429 carry a Retry-After header. Faces sent as https links from your own storage skip the upload limits altogether. Give each customer's request an Idempotency-Key built from your own ids: a retry after a timeout then returns the first edit instead of starting a second one, for 24 hours (idempotency).
import csv
import os
import time
import requests
API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
TEMPLATE = "https://cdn.example.com/campaigns/winter/template.mp4"
def submit(customer):
"""Start one customer's edit; on a 429, wait and send it again with the same key."""
while True:
res = requests.post(
f"{API}/videos/edits",
headers={**HEADERS, "Idempotency-Key": f"winter-2026:{customer['id']}"},
json={
"model": "fp-replace-1",
"video": TEMPLATE,
"faces": [customer["face_url"]],
"resolution": "768p",
},
)
if res.status_code == 429:
time.sleep(int(res.headers.get("Retry-After", "10")))
continue
gen = res.json()
if gen.get("error"):
print(customer["id"], "refused:", gen["error"]["code"]) # nothing is held for it
return None
return gen
# Only customers who opted in are in this file
with open("consented_customers.csv", newline="") as file:
for customer in csv.DictReader(file):
gen = submit(customer)
if gen:
print(customer["id"], gen["id"], "held", gen["reserved_usd"])Store each generation id next to its customer id: the webhook below sends the id back when the edit settles.
Delivery: webhooks, your storage, the customer's link
Add an endpoint under Webhooks in the dashboard for generation.succeeded and generation.failed. Each delivery carries the generation as GET returns it and is signed in the Frameport-Signature header, which your receiver should verify before acting.
- On success, download
outputs[0].urlstraight away, since the signed link opens for about an hour, and copy the clip to your own storage: files are not kept forever. Then send the customer a link from your own domain, by email or in your app. - On failure, nothing was charged. Submit again with a new
Idempotency-Key(the old one would return the failed edit), or skip that customer. - A name on screen goes on in post. Writing it to a file first keeps quotes and accents in names from breaking the ffmpeg command:
printf '%s' "$FIRST_NAME" > name.txt
ffmpeg -i swapped.mp4 -vf "drawtext=fontfile=Inter-Bold.ttf:textfile=name.txt:fontsize=64:fontcolor=white:x=(w-text_w)/2:y=h-220" -c:a copy personalized.mp4The webhooks guide builds a full receiver, with retries and duplicate deliveries handled.
Cost per personalized video
| Item | 768p | 1080p |
|---|---|---|
| The template, 8 s on Frameport Motion 1, once | $0.48 | $0.64 |
| Each customer, on an 8-second template | $0.96 | $2.00 |
| Each customer, on a 10-second template | $1.20 | $2.50 |
So a thousand customers on an 8-second template at 768p cost a thousand times $0.96, and an edit that fails costs nothing. To confirm the number before a batch, quote one edit with its length, {"model": "fp-replace-1", "seconds": 8} (quotes). The balance only has to cover what runs: with 20 edits at a time, no more than 20 holds sit on it at once. A key used for one campaign alone shows that campaign's spend under Usage, by key, with a CSV export. Pricing explains the balance, and the face swap video API guide covers a single edit end to end.
To budget a run, see face swap API pricing for video. A script that swaps the faces of a long clip piece by piece is in how to swap faces in a video with Python. Versions per market rather than per viewer are covered in video ad localization.
FAQ
What is personalized video AI?
It is one video made in many copies, each with something specific to one viewer. Here the specific part is the face: each customer's photo is swapped onto the person in a template clip, and you add text such as a name on top afterwards.
Can I put each customer's name in the video?
Yes, as text you add after the edit, with ffmpeg or any video tool. The edit changes faces only, and the sound stays the template's, so nobody says the name aloud.
Do customers have to agree before their face is used?
Always. Ask them to opt in with a clear sentence, keep a record of it, and delete their photo and video when they withdraw. Real people without their consent are never allowed, and neither is anyone under age.
How many personalized videos can I make at once?
The limits are per minute, not per day: a workspace starts up to 60 requests a minute and runs 20 edits at a time; a loop that waits for Retry-After on a 429 keeps a long batch moving.
Is there a free personalized video API?
The account, the API key and quotes are free, and a failed edit costs nothing. Each edit that comes out is paid from a prepaid balance, from $0.12 per second of clip at 768p, with no subscription.