SweetRouterAPI

Images and video

Videos

Animate a first frame with a prompt, optionally ending on a last frame.

Video generation is at full capacity

We aren't taking new users for this endpoint right now. Contact us to join the waitlist and we'll let you know when a spot opens.

POST/v1/videos

Request body

Videos
FieldTypeDescription
first_frame_url
Required
string (URL)The http or https image the video starts from.
prompt
Required
stringWhat happens in the clip, including sound cues. Up to 4,000 characters.
last_frame_url
Optional
string (URL)An optional image the video ends on.
duration
Optional
integerLength in seconds, 1 to 15. Default 5.
resolution
Optional
string480p (about 768×384) or 720p (about 1280×704, default). Sizes shown for 16:9.
aspect_ratio
Optional
stringAny image aspect ratio. The first frame is center-cropped to fit. Default 2:3.
audio
Optional
booleanDefault true. Set false for a silent clip.
webhook_url
Optional
string (URL)An https URL to notify when this job finishes. See Webhooks.

Example

curl
curl -X POST https://api.sweetrouter.com/v1/videos \
  -H "Authorization: Bearer $SWEETROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_frame_url": "https://example.com/frame.png",
    "prompt": "she turns toward the camera and smiles",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "9:16",
    "audio": true
  }'

The call returns the job right away with status queued. Poll GET /v1/jobs/:id or use a webhook, then download each outputs[].url.

Frame rate and queueing

Videos render at 24 frames per second. One image or video generates at a time, and queued images run before queued videos.

Billing

Videos are charged per second of requested length when the job is created, and refunded if they fail. See Pricing.

Safe retries

Send an Idempotency-Key header. Retrying with the same key returns the original job instead of creating and charging a new one.

curl
curl -X POST https://api.sweetrouter.com/v1/images \
  -H "Authorization: Bearer $SWEETROUTER_API_KEY" \
  -H "Idempotency-Key: order-8812-hero" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a lighthouse at dusk"}'