API Get key

YouTube

Storytime Shorts

A funny thing that happened, told by a cartoon you, in six shots

From
240 crper ad
Endpoint
POST /api/v1/studio/storytime/runs
Workflow id
storytime

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/storytime/estimate \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "card": "story",
    "inputs": {"plan": "{\"hero\": \"a young woman with a short black bob, big round eyes, a plain green hoodie, light blue jeans and white sneakers\", \"place\": \"a small cosy studio apartment with a sunny window, a sofa and a little kitchen\", \"title\": \"The plant\", \"shots\": [{\"shows\": \"The hero stands in the middle of the apartment proudly holding up a small potted plant with both hands, beaming.\", \"line\": \"I bought a plant to prove I'\''m a responsible adult.\"}, {\"shows\": \"The hero pours water from a big watering can into the pot until it overflows onto the floor, nodding seriously.\", \"line\": \"I watered it every single day. Twice, to be safe.\"}, {\"shows\": \"The plant droops. The hero carries it to the window and sets it in the blazing sunshine, then fans it with a hand.\", \"line\": \"It started drooping, so I gave it more sun.\"}, {\"shows\": \"The hero pulls the plant up by its stem and the whole thing lifts out of the soil in one stiff piece, with a plastic base and no roots. The hero'\''s eyes go wide.\", \"line\": \"Then I found out it'\''s made of plastic.\"}, {\"shows\": \"The hero sits on the floor beside a puddle of water, holding the dripping plastic plant, staring at it.\", \"line\": \"I'\''ve been watering a fake for three whole weeks.\"}, {\"shows\": \"The hero hugs the plastic plant to their chest on the sofa\", \"line\": \"And honestly? It'\''s the only thing I'\''ve ever kept alive.\"}]}"}
  }' | 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/storytime/runs \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "card": "story",
    "inputs": {"plan": "{\"hero\": \"a young woman with a short black bob, big round eyes, a plain green hoodie, light blue jeans and white sneakers\", \"place\": \"a small cosy studio apartment with a sunny window, a sofa and a little kitchen\", \"title\": \"The plant\", \"shots\": [{\"shows\": \"The hero stands in the middle of the apartment proudly holding up a small potted plant with both hands, beaming.\", \"line\": \"I bought a plant to prove I'\''m a responsible adult.\"}, {\"shows\": \"The hero pours water from a big watering can into the pot until it overflows onto the floor, nodding seriously.\", \"line\": \"I watered it every single day. Twice, to be safe.\"}, {\"shows\": \"The plant droops. The hero carries it to the window and sets it in the blazing sunshine, then fans it with a hand.\", \"line\": \"It started drooping, so I gave it more sun.\"}, {\"shows\": \"The hero pulls the plant up by its stem and the whole thing lifts out of the soil in one stiff piece, with a plastic base and no roots. The hero'\''s eyes go wide.\", \"line\": \"Then I found out it'\''s made of plastic.\"}, {\"shows\": \"The hero sits on the floor beside a puddle of water, holding the dripping plastic plant, staring at it.\", \"line\": \"I'\''ve been watering a fake for three whole weeks.\"}, {\"shows\": \"The hero hugs the plastic plant to their chest on the sofa\", \"line\": \"And honestly? It'\''s the only thing I'\''ve ever kept alive.\"}]}"},
    "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/storytime/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/storytime/runs/$ID/outputs.zip" -H "Authorization: Bearer $STAGLIGHT_API_KEY"

What it costs

TemplateFinal, best textDraft, fast and cheap
Storytime Short480 cr240 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 story
inputs.ideaYour idea string
inputs.planThe plan string
inputs.drawSurprise story string
inputs.languageLanguage enum auto, en, es
qualityQuality enum final, draft
aspectShape enum 9:16, 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