API Get key

Video

UGC Video

One product image, one line of description, one video

From
169 crper ad
Endpoint
POST /api/v1/studio/ugc_video/runs
Workflow id
ugc_video

Real outputs of this workflow.

The request

# 0. Upload your file first. Its id goes in the body.
MEDIA_ID=$(curl -s -X POST https://staglight.ai/api/v1/uploads \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" -F file=@product.jpg | jq -r .id)

# 1. Price it. Free, nothing is charged.
PRICE=$(curl -s -X POST https://staglight.ai/api/v1/studio/ugc_video/estimate \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "card": "demo",
    "inputs": {"description": "Your words here"},
    "media": {
      "product": ["'"$MEDIA_ID"'"]
    }
  }' | jq .credits)
echo "$PRICE"

# 2. Start it. max_credits refuses anything above that price; the Idempotency-Key stops a double charge.
START=$(curl -s -X POST https://staglight.ai/api/v1/studio/ugc_video/runs \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "card": "demo",
    "inputs": {"description": "Your words here"},
    "media": {
      "product": ["'"$MEDIA_ID"'"]
    },
    "max_credits": '"$PRICE"'
  }')

ID=$(echo "$START" | jq -r .id)

# 3. Wait until it finishes.
while :; do
  STATUS=$(curl -s "https://staglight.ai/api/v1/studio/ugc_video/runs/$ID" -H "Authorization: Bearer $STAGLIGHT_API_KEY" | jq -r .status)
  case "$STATUS" in succeeded|partial|failed) break ;; esac; sleep 10
done

# 4. Download every file in one zip.
curl -s -L -o result.zip "https://staglight.ai/api/v1/studio/ugc_video/runs/$ID/outputs.zip" -H "Authorization: Bearer $STAGLIGHT_API_KEY"

What it costs

TemplateFinal, best text
Presenter demo169 cr
Talks about it169 cr
Scene comes alive169 cr

Prices from the server at the default settings. The estimate call gives the exact price for your inputs, for free.

Inputs

NameTypeAllowed
cardrequiredThe template string demo, talk, scene
media.productProduct image media id[]
media.personPerson reference media id[]
media.scene_refScene reference media id[]
media.startStart frame media id[]
media.endEnd frame media id[]
inputs.descriptionrequiredWhat happens string
inputs.motionWhat moves (optional, the video only) string
inputs.saySpoken line (optional, turns on voice) string
inputs.wordmarkProduct name as printed (optional) string
inputs.genderWho's showcasing it enum man, woman
inputs.setScene enum bathroom, bedroom, kitchen, car, park, street
inputs.shotsShot style enum single, multi
inputs.framingShot distance enum wide, medium, close
inputs.modelModel enum kling, veo_fast, veo_best
inputs.durationDuration enum 5, 10, 15
inputs.soundNative sound bool
inputs.hooksHooks (optional) string
inputs.insert_actionWhat the hands do in the close-up enum turn, unscrew, pump, flip, press
inputs.nicheNiche / category string
inputs.product_infoProduct description & key selling points string
qualityQuality enum final
aspectShape enum 9:16, 1:1, 16:9

Files are media ids from POST /api/v1/uploads. View documentation

Try it by hand

The same workflow runs in the studio, on the same balance. Use it to see the result before you write code.

Sign up to try it

More workflows