AI UGC Video API: Product Ads at Scale
An AI UGC video API workflow for product ads: one presenter, the product in frame, vertical clips with sound, variants to test and the cost per ad.
Updated 5 min read
An AI UGC video API makes the phone-style clips of product ads from your own code: a presenter holds your product and says a hook to the camera, in a vertical clip with sound. With Frameport, one key and one prepaid balance cover every step, from the presenter's portrait on Frameport Image 3 to the clips on Seedance 2.5, Veo 3.1 Fast or Frameport Motion 1 and an upscale of the winning take, each priced before it runs and charged only if it succeeds.
This guide builds the pipeline: a presenter who stays the same, the product in every shot, vertical clips with sound, a batch of variants from a spreadsheet, and what each ad costs.
What a UGC ad needs
A UGC ad looks like something a customer filmed: one person, a phone held at arm's length, a product in hand, and a line in the first seconds that makes a viewer stop scrolling. Each part maps to a field of the request:
| Part | What it is | In the request |
|---|---|---|
| Presenter | The same person in every variant | A portrait in reference_images, with reference_mode: "identity" |
| Product | Your real packaging, label readable | A product photo, as the second picture |
| Hook | The line that opens the ad | Dialogue in quotes in the prompt |
| Format | Vertical, with sound | aspect_ratio: "9:16" and audio: true, the default |
An AI presenter is not a customer: don't present a made-up testimonial as a real one, and follow each ad platform's rules on AI-made content.
A presenter who stays the same
Invent the presenter, or work with a real creator who agreed to it: a real person's face without their consent is never allowed (see the acceptable use policy). For an invented presenter, four takes of a portrait on Frameport Image 3 cost $0.10:
import os
import time
import requests
API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
res = requests.post(f"{API}/images/generations", headers={**HEADERS, "Idempotency-Key": "presenter-1"}, json={
"model": "fp-image-3",
"prompt": "Portrait of a woman in her late twenties with curly dark hair and a denim jacket, friendly smile, "
"looking into the lens, soft daylight, plain light grey background",
"n": 4,
"aspect_ratio": "3:4",
})
if not res.ok:
raise SystemExit(res.json()["error"]["message"])
gen = res.json()
while gen["status"] in ("queued", "running"):
time.sleep(3)
gen = requests.get(f"{API}/generations/{gen['id']}", headers=HEADERS).json()
for output in gen["outputs"]:
print(output["status"], output["id"], output.get("url"))Open the links, keep the take you like, and reuse its file id (file_…) in every clip. Files are not stored forever, so copy the portrait to your own storage and send it by URL in later batches.
Third-party models apply their makers' policies, and some may refuse a realistic face as a reference. A refused clip costs nothing, so try your presenter on one short draft before you run a batch.
The product in every shot
The product goes in as the second picture. Send your best packshot: the product alone, label facing the camera, on a plain background. A local file goes up once with POST /v1/uploads, and its upl_… id works in any request for 24 hours:
curl "https://frameport.ai/v1/uploads?filename=bottle.png" \
-H "Authorization: Bearer $FRAMEPORT_API_KEY" \
-H "Content-Type: image/png" \
--data-binary @bottle.pngThen name each picture in the prompt by its place, "the woman from the first picture holds the bottle from the second picture", and say what the hands do and where the label faces. For shots of the product alone, send the packshot as an identity reference on Frameport Motion 1 and describe the scene ("the bottle from the picture on a gym bench, slow push-in"), or start the clip on a styled product photo as its first frame: five seconds at 768p cost $0.30. The guide to consistent characters in AI video covers identity references and first frames in depth.
Vertical clips with sound
| Model | Lengths | Resolutions | Sound | Reference pictures |
|---|---|---|---|---|
| Seedance 2.5 | 4 to 30 seconds | 480p and 720p | On or off, same price | Up to 4 |
| Veo 3.1 Fast | 4, 6 or 8 seconds | 720p, 1080p and 4K | On or off, priced apart | Up to 3 |
| Frameport Motion 1 | 5 to 15 seconds | 480p, 768p, 1080p and 2K | On or off, same price | Up to 4, at 768p and 1080p |
All three render 9:16. Seedance 2.5 and Veo 3.1 Fast voice the lines you write: put the line in quotes after the speaker, and keep it to one or two short sentences for an eight-second clip. Describe the camera as a phone ("selfie angle, handheld, slight shake, natural window light") and the sound under the voice ("kitchen room tone"). Veo 3.1 Fast prices sound apart, so a silent product shot costs less there.
An AI UGC video API pipeline: variants from a sheet
Ad testing needs variants: the same presenter and product with different hooks and settings. Put them in a sheet, one row each:
id,setting,hook
kitchen-1,a small sunny kitchen,I didn't think a water bottle could change my mornings.
commute-1,a bus seat by the window,This is the only bottle that survived my commute.
gym-1,a gym locker room,POV: your water is still cold after leg day.The script prices the whole batch and stops if the balance does not cover it, then submits each row as a slot frees up and saves each clip under its row id. Each row's Idempotency-Key comes from its id, so running the script again after a crash gives back the clips already started instead of paying for them twice:
import csv
import mimetypes
import os
import time
import requests
API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
PRESENTER = os.environ["PRESENTER"] # the portrait: its file id (file_…) or an https URL
PRODUCT = os.environ["PRODUCT"] # the packshot: an upload id (upl_…) or an https URL
def body_for(row: dict) -> dict:
return {
"model": "seedance-2-5",
"prompt": (
"Vertical UGC-style video shot on a phone, selfie angle, handheld, natural window light. "
f"The woman from the first picture sits in {row['setting']}, holds the bottle from the second picture "
f'with its label toward the camera, and says: "{row["hook"]}" Soft room tone under her voice.'
),
"reference_images": [PRESENTER, PRODUCT],
"reference_mode": "identity",
"duration": 8,
"resolution": row.get("resolution") or "480p",
"aspect_ratio": "9:16",
"max_cost_usd": 2.16,
}
def error_code(res: requests.Response) -> str:
return "" if res.ok else res.json()["error"]["code"]
with open("variants.csv", newline="", encoding="utf-8") as sheet:
rows = list(csv.DictReader(sheet))
if not rows:
raise SystemExit("variants.csv has no rows")
# 1. Price the whole batch before anything runs (quotes are free and hold nothing)
total, available = 0.0, 0.0
for row in rows:
quote = requests.post(f"{API}/generations/quote", headers=HEADERS, json=body_for(row))
if not quote.ok:
raise SystemExit(f"{row['id']}: {quote.json()['error']['message']}")
total += quote.json()["price_usd"]
available = quote.json()["available_usd"]
print(f"{len(rows)} variants for ${total:.2f}, ${available:.2f} available")
if total > available:
raise SystemExit("Add funds or shorten the sheet first.")
# 2. Submit as slots free up, read what runs, save what succeeds
pending, running = list(rows), {}
while pending or running:
while pending:
row = pending[0]
res = requests.post(f"{API}/videos/generations", headers={**HEADERS, "Idempotency-Key": f"ugc-{row['id']}"}, json=body_for(row))
if res.status_code == 429 or res.status_code >= 500 or error_code(res) == "request_in_progress":
break # no slot yet: read the running clips, then try again
pending.pop(0)
if res.ok:
running[res.json()["id"]] = row
else:
print(row["id"], "refused, not charged:", res.json()["error"]["message"])
time.sleep(10)
for gen_id, row in list(running.items()):
gen = requests.get(f"{API}/generations/{gen_id}", headers=HEADERS).json()
if gen["status"] in ("queued", "running"):
continue
del running[gen_id]
if gen["status"] != "succeeded":
print(row["id"], "failed, not charged:", gen["error"]["message"])
continue
output = gen["outputs"][0]
name = row["id"] + (mimetypes.guess_extension(output["content_type"]) or ".mp4")
with requests.get(output["url"], stream=True) as video, open(name, "wb") as out:
video.raise_for_status()
for chunk in video.iter_content(chunk_size=1 << 20):
out.write(chunk)
print(row["id"], "saved", name, "file", output["id"], "charged", gen["cost_usd"])Drafts run at 480p, at $0.96 a variant. To finish a winner, add a row with a new id and 720p in a resolution column: the same id with a changed row is refused for 24 hours with 409 idempotency_conflict. Then upscale the final take to 1080p with Frameport Upscale 1, by its file id:
{ "model": "fp-upscale-1", "video": "file_5Wd1KcR8nTq3Lx7Vb2MzPa", "resolution": "1080p" }To switch the batch to Veo 3.1 Fast, change model and set resolution to one of its own. For a large batch, a webhook can replace the reading loop, and the same sheet can drive an n8n workflow instead of a script.
Cost per ad and per variant
Each line is charged only if it succeeds; a failed or refused clip costs nothing.
| Step | Model | Setting | Price |
|---|---|---|---|
| Presenter, four takes, once | Frameport Image 3 | 3:4 | $0.10 |
| Draft variant | Seedance 2.5 | 8 s, 480p, with sound | $0.96 |
| Final variant | Seedance 2.5 | 8 s, 720p, with sound | $2.16 |
| Final variant | Veo 3.1 Fast | 8 s, 1080p, with sound | $1.12 |
| Product shot | Frameport Motion 1 | 5 s, 768p | $0.30 |
| Upscale | Frameport Upscale 1 | 8 s to 1080p | $0.24 |
A batch of drafts costs the draft price times the number of rows, and the script prints that total from the quotes before anything runs. An ad made of a final hook and a product shot costs those two lines together. The guide to pricing a clip before it runs covers quotes, holds and max_cost_usd.
Turning one brief into many ad variants is covered in AI video ads by API. For the 9:16 format and the lengths each platform takes, see the vertical AI video generator API.
FAQ
What is an AI UGC video API?
An API that makes ad clips in the style of user-generated content: a presenter, a product and a spoken line, rendered as a vertical clip with sound. Here it is the standard video endpoint with identity references, so the same presenter and product appear in every variant.
Can I use a real creator's face?
Only with their consent, for the uses they agreed to. Some third-party models may refuse a realistic face as a reference whatever its source, and a refused request costs nothing.
Which models make UGC clips with dialogue?
Seedance 2.5 and Veo 3.1 Fast voice a line written in quotes, with the sound of the scene around it. Frameport Motion 1, our own engine, suits the product shots between hooks, with sound on or off at the same price.
How much does an AI UGC ad cost?
A draft variant is $0.96 and a final one at 720p $2.16, plus the presenter's portrait once. POST /v1/generations/quote gives the exact price of each request before it runs.
Is there a free AI UGC video API?
Creating a key, listing models and quotes are free, and there is no subscription. Clips are paid from a prepaid balance only when they succeed, from $0.02 a second.
Can I make UGC photos as well?
Yes. Frameport Image 1 composes the presenter and the product in one picture from up to 10 reference pictures, for thumbnails and static ads, at $0.025 an image plus a little for each reference after the first.