Product Photo to 9:16 Video With 2 API Calls: $0.5288 a Clip, or $0.7703 If You Keep 1 Default
2 API calls turn 1 product photo into a 5-second vertical clip for $0.5288: Nano Banana Edit stages the product for $0.0458, and Kling 3.0 Standard animates it for $0.483. Skip 1 line of code, generate_audio: false, and Kling bills the sound rate instead, so the same clip costs $0.7703 for audio you’ll mute under your Reels track.
What you’re building
A 60-line Python script, product_clip.py. You give it a photo of your product and a sentence about the scene. It returns a 5-second 9:16 MP4 you can post as a Reel, a TikTok or a Short, or loop above the fold on a landing page.
It makes 2 jobs on one API with one key:
- Step 1, the still.
nano-banana/edittakes your photo and puts the product in a new vertical scene: a kitchen table, a marble counter, a desk. - Step 2, the motion.
kling-video/v3/standard/image-to-videouses that still as the first frame and animates it: a slow push-in, steam, shifting light.
Why 2 steps and not 1 text-to-video prompt? Because a text-to-video model invents a product. Starting from your own photo keeps the shape, color and label you actually sell, and the video model only has to add motion.
The result, and what it cost
Here is one run. To keep a real brand out of the post, we made the still from a text prompt with Nano Banana instead of editing a photo; with your own product, step 1 is the edit call in the script below.

On MegaBrain’s model pages, that run costs $0.0458 for the still and $0.0966 × 5 = $0.483 for the clip: $0.5288 in total. The last clause of the motion prompt, “the mug does not move or change shape”, tells the model to leave the product alone and move only the camera, the steam and the light. A product clip where the product changes is a clip you throw away.
The cost of one run, by model
You can swap either step. The prices below are the per-second and per-image prices on each model’s MegaBrain page; the 5-second totals are those prices × 5.
| Video model (image to video) | Per second, no sound | Per second, with sound | 5 s, no sound | 5 s, with sound |
|---|---|---|---|---|
| Kling 2.6 Pro | $0.0805 | $0.161 | $0.4025 | $0.805 |
| Kling 3.0 Standard | $0.0966 | $0.1449 | $0.483 | $0.7245 |
| Kling 3.0 Pro | $0.1288 | $0.1932 | $0.644 | $0.966 |
| Still model (edit) | Per image |
|---|---|
| Nano Banana Edit | $0.0458 |
| Seedream 4.5 Edit | $0.046 |
| Nano Banana Pro Edit | $0.1725 |
2 things stand out. First, sound is the biggest single line on the bill: it adds 50% on Kling 3.0 and doubles the price on Kling 2.6 Pro. Second, the still is cheap. Even Nano Banana Pro Edit costs less than 2 seconds of Kling 3.0 Standard, so spend on the image model if your product has fine print or a detailed label.
Kling 3.0 Standard and Pro take any whole length from 3 to 15 seconds; Kling 2.6 Pro takes 5 or 10. A 10-second Kling 3.0 Standard clip without sound costs $0.966.
The default that adds 50%. In the parameter list for Kling 3.0 image to video, generate_audio defaults to true. If your request leaves the field out, you pay $0.1449 a second instead of $0.0966. For a clip that will run under trending audio, that is money for sound nobody hears. Send "generate_audio": false.
The code
It uses the queue pattern from the media API docs: submit a job to /queue/<model id>, poll its status_url until it says COMPLETED or FAILED, then read response_url. The only dependency is requests.
"""product_clip.py: 1 product photo -> 9:16 scene -> 5-second clip.
Usage: python product_clip.py mug.jpg "on a light oak table, soft morning window light"
"""
import base64
import mimetypes
import os
import sys
import time
import requests
BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}
def run(model: str, body: dict) -> dict:
"""Submit a job to the queue, wait for it, return the model's output."""
r = requests.post(f"{BASE}/queue/{model}", headers=HEADERS, json=body, timeout=60)
if r.status_code != 200:
# 400 = unknown field, 402 = balance too low, 422 = input rejected (not charged)
sys.exit(f"{model}: {r.status_code} {r.text}")
job = r.json()
while True:
status = requests.get(job["status_url"], headers=HEADERS, timeout=30).json()["status"]
if status == "COMPLETED":
break
if status == "FAILED":
sys.exit(f"{model} failed; the price goes back to your balance")
time.sleep(4)
return requests.get(job["response_url"], headers=HEADERS, timeout=60).json()
def data_url(path: str) -> str:
mime = mimetypes.guess_type(path)[0] or "image/jpeg"
with open(path, "rb") as f:
return f"data:{mime};base64,{base64.b64encode(f.read()).decode()}"
def main() -> None:
photo, scene = sys.argv[1], sys.argv[2]
# Step 1: put the product in a vertical scene (Nano Banana Edit)
still = run(
"nano-banana/edit",
{
"prompt": (
f"Place this exact product {scene}. Keep its shape, color, label and "
"proportions unchanged. Product photo, shallow depth of field, "
"empty space above the product, no added text, no added logo."
),
"image_urls": [data_url(photo)],
"aspect_ratio": "9:16",
},
)
still_url = still["images"][0]["url"]
print("still:", still_url)
# Step 2: animate it (Kling 3.0 Standard, image to video)
clip = run(
"kling-video/v3/standard/image-to-video",
{
"prompt": (
"Slow push-in toward the product, light shifts gently across the scene, "
"camera stays steady, the product does not move or change shape"
),
"start_image_url": still_url,
"duration": "5",
"generate_audio": False, # the default is True, and sound costs 50% more
},
)
video_url = clip["video"]["url"]
with open("clip.mp4", "wb") as f:
f.write(requests.get(video_url, timeout=120).content)
print("saved clip.mp4 from", video_url)
if __name__ == "__main__":
main()Run it:
pip install requests
export MEGABRAIN_API_KEY="your key"
python product_clip.py mug.jpg "on a light oak table next to a linen napkin, soft morning window light"How the script works, line by line
The photo travels as a data: URL. image_urls accepts https:// or data: URLs, so you don’t need to host the photo anywhere first. The edit model takes up to 10 images, which is handy if you want to pass the front and the back of a box.
The shape comes from step 1. Kling’s image-to-video parameters have no aspect-ratio field. Ask Nano Banana Edit for aspect_ratio: "9:16" and the vertical frame carries into the clip. For a landing-page hero, ask for 16:9 instead.
Duration is a string. Kling takes "5", not 5. A field the model doesn’t list gets a 400.
You pay at submit, and failures refund. The price is calculated and charged when the job is queued. If the job ends FAILED, the full price goes back to your balance; if the model rejects the input with a 422, nothing is charged. A 402 means the balance is too low.
Polling every 4 seconds is enough. The docs suggest 2 to 5 seconds.
Make 20 clips from 20 photos
Wrap the script in a loop and run one job at a time. At $0.5288 a run, 20 products cost $10.576 with the settings above.
# batch.py: one clip per photo in ./products, with the same scene
import pathlib
import subprocess
for photo in sorted(pathlib.Path("products").glob("*.jpg")):
subprocess.run(
["python", "product_clip.py", str(photo), "on a white marble counter, soft daylight"],
check=True,
)
pathlib.Path("clip.mp4").rename(photo.with_suffix(".mp4"))The same 2 HTTP calls work from n8n or Make: an HTTP Request node to submit, a Wait node, and a loop on the status URL. Nothing in the flow needs Python.
Build it with Cursor, Claude Code or Codex
If you vibe code, paste this into your agent. It has every endpoint, field and default the agent needs, so it doesn’t have to guess:
Build a Python CLI, product_clip.py, that turns one product photo into a
5-second vertical video using the MegaBrain API.
API: base URL https://getmegabrain.com/api/gateway/v1, header
"Authorization: Bearer $MEGABRAIN_API_KEY". Jobs go to POST /queue/<model id>
and return status_url and response_url. Poll status_url every 4 seconds until
COMPLETED or FAILED, then GET response_url. Docs: https://getmegabrain.com/docs/media
Step 1: model "nano-banana/edit". Body: prompt, image_urls (a list with the
photo as a data: URL), aspect_ratio "9:16". Output: images[0].url.
Step 2: model "kling-video/v3/standard/image-to-video". Body: prompt,
start_image_url (the step 1 URL), duration "5", generate_audio false.
Output: video.url. Download it to clip.mp4.
Arguments: the photo path and a scene description. Print a clear message on
HTTP 400, 402 and 422 and on a FAILED job. Then add a --batch folder option
that writes one .mp4 per .jpg/.png in the folder, one job at a time.Prompts that waste money
- Asking for a camera move and an object move at once. “Orbit around the bottle while it spins” gives the model 2 motions to fight over. Pick one: the camera moves, the product stays.
- Re-describing the product in the video prompt. The first frame already shows it. Describe motion and light, not the object, or the model may “correct” it toward your words.
- A busy still. Every prop in step 1 is something Kling can animate. Ask for empty space and few props, then let the motion prompt add steam, light or fabric.
- Going to 10 seconds before 5 works. A 5-second test costs half as much as a 10-second one. Get the motion right short, then extend.
What this means if you build with AI media
Read the defaults, not only the price. The cheapest model on a pricing page can cost more than the next tier up if a default you never set is billing you. In the table above, Kling 3.0 Standard with sound ($0.7245 for 5 seconds) costs more than Kling 3.0 Pro without it ($0.644).
Spend on the still, save on the seconds. Video is billed per second; the image is billed once. Fix composition, label and lighting in step 1, where a retry costs cents, before you pay for motion.
Keep the product photo yours. Start from a real photo of the real item. It keeps the clip honest about what the customer gets, and it is the only way the label and color come out right.
Try it on MegaBrain
Both models run in the playground on their pages before you write a line of code: Kling 3.0 Standard image to video at $0.0966 per second without sound, and Nano Banana Edit at $0.0458 per image, from one pay-as-you-go balance.
Full disclosure: MegaBrain sells pay-as-you-go API access to image, video and text models, including Kling 3.0, Kling 2.6, Nano Banana, Nano Banana Pro and Seedream 4.5. MegaBrain is not affiliated with Kuaishou, Google or ByteDance.
Sources
Pages opened November 11, 2026. Every price above comes from these pages, or from multiplying a per-second price by the clip length where we say so.
- MegaBrain — image and video generation API docs (queue endpoints, statuses, refunds, model parameters)
- MegaBrain — media model catalog as JSON (parameters and defaults of every model)
- MegaBrain — Kling 3.0 Standard, image to video (price per second, with and without sound)
- MegaBrain — Kling 3.0 Pro, image to video
- MegaBrain — Kling 2.6 Pro, image to video
- MegaBrain — Nano Banana Edit
- MegaBrain — Nano Banana Pro Edit
- MegaBrain — Seedream 4.5 Edit
MegaBrain · one API for every model
Claude, GPT, Gemini, FLUX and Kling with one key and one balance.
Pay as you go, no subscription. Try the models in the chat or the playground, then call them through an OpenAI-compatible API.
Newsletter
Stay in the loop
Get our latest AI research and guides. No spam, unsubscribe anytime.