API Get key

YouTube

Ranking Shorts

Five crazy levels, ranked #5 to #1, in one vertical Short

From
190 crper ad
Endpoint
POST /api/v1/studio/ranking/runs
Workflow id
ranking

Real outputs of this workflow.

The request

# 1. Price it. Free, nothing is charged.
PRICE=$(curl -s -X POST https://staglight.ai/api/v1/studio/ranking/estimate \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "card": "ranking"
  }' | 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/ranking/runs \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "card": "ranking",
    "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/ranking/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/ranking/runs/$ID/outputs.zip" -H "Authorization: Bearer $STAGLIGHT_API_KEY"

What it costs

TemplateDraft: 480p testFinal: 720p
Ranking Short190 cr2,050 cr

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

Inputs

NameTypeAllowed
cardThe template string ranking
inputs.topicTopic string
inputs.kindKind of video enum drop, ride
inputs.titleTitle string
inputs.levelsLevels string
inputs.onlyLevels to film chips 5, 4, 3, 2, 1
inputs.accentTitle colours enum red_cyan, orange_mint, pink_yellow, amber_sky, coral_violet, own
inputs.accent1Line 1 colour string
inputs.accent2Line 2 colour string
inputs.watermarkWatermark (optional) string
inputs.punchPunch-in zoom on every hit bool
qualityQuality enum draft, final
aspectShape enum 9:16

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