Log segment count and billable minutes per holiday ad
Read segment_count, billable_minutes, and warnings from each Sume timeline render result and log one cost line per holiday ad. A Python script, no network.

A completed Sume timeline render returns kind: timeline_render with video_url, duration_seconds, segment_count, billable_minutes, and optional warnings[]. Write those into one line per ad and you have a cost log for the holiday run. The rate is $0.10 per billable minute, so the cost of an ad is billable_minutes times 0.10.
The result fields come from Timeline 1.0 and the polling steps from Jobs and results (read 2026-10-06). The script reads the result JSON from standard input, so it needs no key and runs offline.
What does one result look like?
Fetch it with GET /v1/jobs/:id/result after the job status is completed. A plan can predict minutes, but not padding or looping, so the render's own warnings are the record of what actually happened.
| Field | Meaning |
|---|---|
| duration_seconds | Length of the rendered MP4 |
| segment_count | Number of video slots rendered |
| billable_minutes | Output minutes billed, rounded up |
| warnings[].code | Soft degradations such as snapped transitions |
How do I turn it into a log line?
Pass the ad name as the first argument and pipe the result in. The script accepts the result as is, or wrapped in a result key.
import json, sys
RATE_USD_PER_MINUTE = 0.10
def log_line(ad_name, result):
result = result.get("result", result)
minutes = result["billable_minutes"]
warnings = [w.get("code", "?") for w in result.get("warnings", [])]
return ",".join([
ad_name,
str(result["duration_seconds"]),
str(result["segment_count"]),
str(minutes),
f"{minutes * RATE_USD_PER_MINUTE:.2f}",
"|".join(warnings),
])
if __name__ == "__main__":
print("ad,duration_seconds,segment_count,billable_minutes,cost_usd,warnings")
print(log_line(sys.argv[1], json.load(sys.stdin)))What should I do with the warnings?
Warnings are soft degradations, not failures: the render still returns a video. Keep the codes in the log so you can spot a pattern, such as a clip that is always padded.
- A list of ads with the same warning usually shares a source clip that is too short.
- Add the job id to the line if you want to trace it, and keep the idempotency key of the request next to it.
- Cost is a rate times minutes. Confirm the live rate in
GET /v1/catalogbefore you trust the constant.
Sources
Related posts
More in Use cases
- Only 12 left badge over a product clip: compose overlay, $0.02
A low-stock badge on a product clip is $0.02 per variant with Sume compose overlay. Set position, width_ratio and margin_ratio; re-render as stock drops.
- Match compose output to the timeline size: no double rescale
Sume timeline compose defaults to 1080x1920. Set output width, height, and fps to the timeline you join it into, so the holiday shot is not rescaled twice.
- Meta One Advanced schedules stories 30 days out: render a month first
Meta One's Advanced plan ($49.99 a month) can schedule stories up to 30 days ahead. Render 30 vertical clips in one pass with Sume Timeline for about $3.
- Meta One lets Advanced add links to reels: burn a CTA, not a URL
Meta One Advanced adds links in organic posts and reels, so the clip itself only needs a short call to action. Burn it with Sume caption cues for $0.20.
Written by Sume