← Highlight Reel Maker
Your token

Highlight Reel Maker API

Opening a video, finding the loud moments, cutting, cropping and recording the reel, and every download run free in the browser and need no API. The API is for the one metered step: send the moments of a video (each with an id, a time, how loud it was and an optional note), the reel length and the order you want, and get back a planned cut. The reply holds moment ids, roles, seconds and music cues only; build the reel and the shot list from your own copy of the moments. The video itself is never sent.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "plan".

taskWhat it doesReply
planPicks which moments make a reel of at most max_seconds, orders them (best moment first, or as it happened), chooses the seconds before and after each moment, a role and a music cue for each clip, and lists the moments left out with a reason.One JSON object

Input fields

Every field is a string; facts and limits hold JSON text. All three are required.

FieldMeaning
task"plan"
factsJSON object: seconds (the video's length), kind (what the video is, may be empty), moments in time order, up to 40, each {id, at, at_text, found, loud, note} with ids m1, m2... (found is loud or hand, loud 0-100 or null), defaults {before, after}, total_moments and sent.
limits{max_seconds, style, before_choices, after_choices}: max_seconds is 15, 30, 45, 60 or 90; style is hook (best moment first) or story (time order); the choices are [1,2,3,4,5,6,8,10].

The reply

job.output.output is text holding one JSON object: clips, in reel order, each {"id", "role", "before", "after", "music"} (role opener, build, peak or closer; music build, hit, steady or fade), and left_out, each {"id", "why"} (over_length, weaker or same_play). A clip runs from at - before to at + after, inside the video. The page checks that every id was sent and is placed once, the seconds are from the choices, the clips add up to no more than max_seconds and do not overlap, the order and roles fit the style, and a moment left out for length really does not fit; do the same checks in your code.

Worked example

Input (input.json), from the page's "Soccer match" example with notes, at most 30 s, best moment first:

{
  "task": "plan",
  "facts": "{\"seconds\":60,\"kind\":\"Sunday league match, blue v red\",\"moments\":[{\"id\":\"m1\",\"at\":0.5,\"at_text\":\"0:00.5\",\"found\":\"loud\",\"loud\":43,\"note\":\"Kick-off\"},{\"id\":\"m2\",\"at\":13.5,\"at_text\":\"0:13.5\",\"found\":\"loud\",\"loud\":82,\"note\":\"Keeper saves a header\"},{\"id\":\"m3\",\"at\":22.5,\"at_text\":\"0:22.5\",\"found\":\"loud\",\"loud\":100,\"note\":\"Goal - blue, number 9\"},{\"id\":\"m4\",\"at\":40.5,\"at_text\":\"0:40.5\",\"found\":\"loud\",\"loud\":97,\"note\":\"Red equalise from a corner\"},{\"id\":\"m5\",\"at\":52,\"at_text\":\"0:52.0\",\"found\":\"loud\",\"loud\":85,\"note\":\"Shot hits the post\"}],\"defaults\":{\"before\":5,\"after\":3},\"total_moments\":5,\"sent\":5}",
  "limits": "{\"max_seconds\":30,\"style\":\"hook\",\"before_choices\":[1,2,3,4,5,6,8,10],\"after_choices\":[1,2,3,4,5,6,8,10]}"
}

Reply:

{"clips":[{"id":"m3","role":"opener","before":3,"after":3,"music":"hit"},{"id":"m2","role":"build","before":3,"after":2,"music":"build"},{"id":"m4","role":"peak","before":6,"after":3,"music":"hit"},{"id":"m5","role":"closer","before":4,"after":2,"music":"fade"}],"left_out":[{"id":"m1","why":"weaker"}]}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or a required field is missing or empty.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://highlight-reel-maker.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"highlight-reel-maker"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "plan", "facts": "{\"seconds\":60,\"kind\":\"Sunday league match, blue v red\",\"moments\":[{\"id\":\"m1\",\"at\":0.5,\"at_text\":\"0:00.5\",\"found\":\"loud\",\"loud\":43,\"note\":\"Kick-off\"},{\"id\":\"m2\",\"at\":13.5,\"at_text\":\"0:13.5\",\"found\":\"loud\",\"loud\":82,\"note\":\"Keeper saves a header\"},{\"id\":\"m3\",\"at\":22.5,\"at_text\":\"0:22.5\",\"found\":\"loud\",\"loud\":100,\"note\":\"Goal - blue, number 9\"},{\"id\":\"m4\",\"at\":40.5,\"at_text\":\"0:40.5\",\"found\":\"loud\",\"loud\":97,\"note\":\"Red equalise from a corner\"},{\"id\":\"m5\",\"at\":52,\"at_text\":\"0:52.0\",\"found\":\"loud\",\"loud\":85,\"note\":\"Shot hits the post\"}],\"defaults\":{\"before\":5,\"after\":3},\"total_moments\":5,\"sent\":5}", "limits": "{\"max_seconds\":30,\"style\":\"hook\",\"before_choices\":[1,2,3,4,5,6,8,10],\"after_choices\":[1,2,3,4,5,6,8,10]}"}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="highlight-reel-maker:plan:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: clips, left_out
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: highlight-reel-maker:plan:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json