Black Friday deposit bonus·Top up $50+ and get $10 · Top up $100+ and get $25·Ends November 30Top up →
Use case

AI UGC ads:
product shots, a presenter and a voiceover from one API key

Make UGC-style video ads from code: product photos from the images API, a presenter who talks in video shots or a swap, and a voiceover from text to speech.

Last updated 2026-11-05

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
party.mp4 · 1:004 shots · 2 peopleshot 1shot 2shot 3shot 4p1chr_miap2"keep"shot 3 · p1 → chr_miaswapped.mp4swappedkeptswappedswappedoriginal sound
Black Friday

Black Friday deposit bonus

Every qualifying top-up earns free credit, on top of any other offer.

Ends November 30

Deposit $50
+$10
20% bonus
Deposit $100
+$25
25% bonus
Sign up and claim

A UGC-style ad is a person holding your product, talking to the camera like a friend, cut into a few short vertical clips. You can make the parts of one from code, with one prepaid key: the product shots with the image generation API, the presenter with video shots (a saved character who speaks your script in their own voice) or with a character swap over footage you filmed, and an optional voiceover with text to speech. This page says which API makes which part, and what is still yours to do: the script, the checks, the edit and the disclosure.

Hand it to your AI agent

Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.

Build a pipeline that turns product photos and an ad script into vertical UGC-style video ads with the Lovely Router images, video shots, joins and speech APIs.

- Docs (read first): https://lovelyrouter.com/docs/models/images.md and https://lovelyrouter.com/docs/api/video-shots.md and https://lovelyrouter.com/docs/api/audio.md
- Images: POST https://lovelyrouter.com/v1/images/edits with the product photos as references. Shots: POST https://lovelyrouter.com/v1/videos/shots (`consent: true`; read the model licence in the docs and tell me if my use or region might not be allowed). Voiceover: POST https://lovelyrouter.com/v1/audio/speech. Join with POST https://lovelyrouter.com/v1/videos/joins.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the product photos, the presenter, the script and the languages>
01

How it works

010203
  1. Shoot the product without a studio

    Send a photo of your product to POST /v1/images/edits as a reference image and describe the scene: on a bathroom shelf, in a gym bag, in a hand by a window. Ask for up to 10 versions in one request with n, at one flat price per image.

  2. Cast a presenter

    Draw a turnaround sheet of your presenter with the images API and save it as a character, free. Give the character a voice: design one from a description with qwen3-tts and save it, or upload a voice that is yours or that you have permission to use.

  3. Film the lines as shots

    Each clip is a shot: POST /v1/videos/shots with a prompt that tags the presenter (@Jess) and puts the line in double quotes. The shot comes back with picture, sound and the line spoken in the character's voice. To open on the product, send a frame as a scene and say the shot starts on it.

  4. Join the cut

    POST /v1/videos/joins puts up to 50 finished shots of the same size together in order, each with its own sound, for free. What you add after that (captions, music, a logo end card) happens in your own editor.

02

The requests

Product shots first, with the OpenAI SDK pointed at https://lovelyrouter.com/v1:

Python
import base64
import os
from openai import OpenAI

client = OpenAI(base_url="https://lovelyrouter.com/v1", api_key=os.environ["LOVELY_API_KEY"])

result = client.images.edit(
    model="gpt-image-2.5-flare",
    image=[open("serum.png", "rb")],
    prompt="The serum bottle from the image on a sunlit bathroom shelf next to a folded towel, phone-camera look, vertical",
    size="1024x1536",
    n=4,
)
for i, image in enumerate(result.data):
    with open(f"serum-{i + 1}.png", "wb") as f:
        f.write(base64.b64decode(image.b64_json))

Then a shot: the presenter is a saved character, and the opening frame (for example one of your product shots edited with the presenter's sheet as a second reference image) is sent as a scene.

cURL
curl "https://lovelyrouter.com/v1/videos/shots?wait=300" \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "minimax-h3-video",
    "consent": true,
    "size": "9:16",
    "seconds": 10,
    "prompt": "The shot opens exactly on @[Opening frame] as its first frame. @Jess picks up the bottle, holds it to the camera and says: \"Okay, this is the one I keep telling you about.\"",
    "characters": ["chr_3b9e1f0c7a2d4e58b6c1a9f2"],
    "scenes": [{"name": "Opening frame", "image": "https://example.com/jess-with-serum.png"}]
  }'

Make the other lines the same way, then join them with POST /v1/videos/joins and {"shots": ["shot_…", "shot_…", "shot_…"]}. The video shots reference covers polling, the tags and the errors.

03

Which API makes which part

Part of the adMade byNotes
Product shots and the opening framesImages API: gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburstUp to 16 reference images per edit, n up to 10, up to 3840×2160
The presenter's lookA turnaround sheet from the images API, saved with POST /v1/characters (sheet_image_job)Free to save, up to 100 per account
The presenter's voiceqwen3-tts designed voice saved with POST /v1/audio/voices, or an uploaded sample with consentLinked to the character as voice_id
Talking clipsVideo shots with minimax-h3-video5–15 s each, 9:16, 16:9 or 1:1, sound and dialogue included
A presenter in your own footageCharacter replacement with mode: "face"Film once, swap the presenter's head per market; hands, clothes and product stay as filmed
A separate voiceoverText to speechAn audio file; you mix it over the video yourself
The final cutPOST /v1/videos/joins, freeJoins shots in order; no captions, music or overlays
04

What you still do

{}
Write the script and the claims

The shot speaks the words you put in quotes, word for word. What your ad promises is your responsibility.

Check the product

A generated image or shot can change small things: the label text, the cap, the colour of the liquid. Look at every frame against the real product before you publish, and regenerate the ones that drifted.

Edit and caption

Joins give you one mp4 with the shots' own sound. Captions, music, a voiceover mix, your logo and the end card are done in your editor or with your own ffmpeg step.

Disclose it

Say the presenter is AI-generated wherever the ad runs, follow the ad platform's rules, and never present a generated presenter as a real customer or a real review.

Check where you may use it

The video models are under the MiniMax H3 terms, which every request accepts with consent: true. They don't allow use in the EU, the UK, South Korea or the US.

05

Recipes

Twenty product angles before lunch

Loop over your catalog and send each product photo with three scene prompts and n: 4, as image jobs so nothing holds a connection open.

The same presenter in every ad

Save the presenter once and reuse the character_id: same face, same clothes, same voice across a whole campaign.

One script, three languages

Send language (en, zh, ja, …) on each shot, with the line translated in quotes.

A real demo, many presenters

Film the product demo yourself, then swap the presenter's head with character replacement for each market, keeping your hands and the product exactly as filmed.

Hooks to test

Render several 5-second opening shots with different first lines, join each one to the same body, and test them as separate ads.

06

What you pay

PartPrice
Product shots, sheets and frames$0.04 per image, any size, generations and edits alike
Video shots$0.13 per rendered second with one picture, plus $0.06 per second for each extra picture
Joins, saved characters, saved voicesFree
Voice design and voiceovers$0.036 per minute of audio
Character replacement$0.2 per second swapped

A 30-second ad made of three 10-second shots, each with the presenter and an opening frame (two pictures), renders 10.13 seconds per shot and costs about $5.77 for the video, plus a few images at $0.04 each. When a shot has two or more characters, a short chat call names everyone in its prompt and is billed as an ordinary chat request. Shots are reserved from your prepaid balance when you submit them and charged when they complete; failed shots cost nothing. Every price is on pricing.

07

Frequently asked questions

?
Is the whole ad generated in one call?+

No. Each part is its own request: images for the product shots, a shot for each clip, a join for the cut. That keeps every step checkable, and you only regenerate the part that missed.

Does the presenter actually talk?+

Yes. Words in double quotes in a shot's prompt are spoken by the character tagged before them, in that character's saved voice when it has one, with the sound made by the video model.

Will my product look exactly like the real one?+

Close, but check it. Reference images keep the shape and colours well, but small text and fine details can change. Compare every frame to the real product and regenerate the ones that drifted.

Can I use my own footage instead of a generated presenter?+

Yes. Film the ad yourself and swap the presenter with character replacement, as a whole person or only the head. The motion, the camera, the cuts and the sound stay.

Can I add music and captions through the API?+

No. Joins put shots together with their own sound. Music, captions, overlays and a separate voiceover are added in your editor.

Where can I run these ads?+

Follow the ad platform's rules and the model's terms. The MiniMax H3 terms don't allow use in the EU, the UK, South Korea or the US, and every generated presenter should be disclosed as AI.

Can an AI agent build this pipeline?+

Yes. Copy the prompt on this page into Claude Code, Cursor or Codex: it reads the Markdown docs and writes the image, shot and join calls with your key.

For still product photography only, see AI product photos; to try a shot first, open the video playground, or create an account and get a key.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.