Automate YouTube Shorts with AI: generate, then upload

You can automate YouTube Shorts with AI as two jobs: generate a vertical video on a schedule, then upload it with the YouTube Data API from your code.

5 min readSume
All posts

You can automate YouTube Shorts with AI, but it is two separate jobs: generating a vertical video on a schedule, and uploading it to your channel. An AI video service handles the first. The upload goes through YouTube's Data API, called by your own code with your channel's authorization; Sume has no YouTube connector.

YouTube's rules are quoted from its Videos: insert and Videos resource API pages and the Help page on three-minute Shorts. The Sume details come from the Scheduled and Runs and results docs. All were read on 2026-09-27.

What makes an upload count as a Short?

Its shape and length, so ask for 9:16 and keep the video under three minutes: on standard channels, YouTube categorizes any video uploaded on or after October 15, 2024 with a square or vertical aspect ratio, up to three minutes long, as a Short. YouTube Shorts video specs covers the file settings.

How do I generate a vertical video on a schedule?

Either your own scheduler calls Sume, or a Sume schedule fires on its own clock:

  • Your scheduler calls a Format. A cron job on your server, or a platform scheduler such as Vercel Cron, starts a Format run with an Idempotency-Key built from the date and a communication.webhook_url. Sume POSTs the receipt to that URL once, when the run completes or fails, and the handler that receives it does the upload.
  • A Sume schedule. You author it in the dashboard with a 5-field cron expression in an IANA timezone, and each fire runs the saved instructions as an Agent in a fresh thread. Collect results by listing the schedule's runs with GET /v1/actions/{action_id}/runs, then reading primary_output_url from each completed run's receipt at GET /v1/action-runs/{run_id}/result.
  • Set the spend cap on both paths. A Format run takes generation_spend_cap_usd on the request. A schedule's per-run generation cap is $1.00 when unset, and a run request can lower it but never raise it, so set it in the dashboard to what one video costs on API pricing.
curl -sS -X POST "https://api.sume.com/v1/formats/acme/daily-short/runs" \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: daily-short-2026-09-27" \
  -d '{
    "instruction": "Vertical 9:16 Short, under 60 seconds, on the topic in the input.",
    "input": { "topic": "Three tips for better sleep" },
    "generation_spend_cap_usd": 15,
    "communication": { "webhook_url": "https://example.com/hooks/sume" }
  }'

What should the webhook handler do before it uploads?

The handler is where the two halves meet, and a careless one uploads the same Short twice:

  • Verify the signature: HMAC-SHA256 over the timestamp and the raw body, checked before you parse it. Signed webhooks for video runs has the verifier.
  • Answer fast. Sume counts any 2xx within 10 seconds as delivered, so record the event durably, answer, then upload.
  • Dedupe on request_id. It equals the run id and every retry repeats it, so a retried delivery must not start a second upload.
  • Upload only when the envelope's status is OK and the receipt's primary_output_url is set. A failed run arrives as ERROR, and a null payload means the receipt was over 1 MiB: fetch it from the error.result_url the envelope names.

How do I upload the video to YouTube automatically?

With the YouTube Data API's videos.insert method. It is a media upload, so your code sends the file itself: download the MP4 from primary_output_url, a durable media.sume.com URL, and pass those bytes to the upload with a video resource that sets properties such as snippet.title and status.privacyStatus.

Two YouTube details shape the automation. Videos uploaded through videos.insert from unverified API projects created after 28 July 2020 are restricted to private viewing until the project passes an audit. And if a generated Short looks realistic, the resource's status.containsSyntheticMedia flag lets the channel owner disclose realistic altered or synthetic content on upload; YouTube's examples include a realistic-looking scene that did not actually occur.

From YouTube's Videos: insert reference, read 2026-09-27.
videos.insertWhat the reference says
EndpointPOST https://www.googleapis.com/upload/youtube/v3/videos
AuthorizationOAuth, with a scope such as https://www.googleapis.com/auth/youtube.upload
Filesvideo/* or application/octet-stream, up to 256GB
Quota100 calls per day; each call costs 1 unit in the Video Uploads quota bucket
VisibilityPrivate only for unverified API projects created after 28 July 2020, until an audit

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume