Skip to main content
POST
Invia un job di generazione di video. Il campo mode seleziona la forma della richiesta (image_to_video, text_to_video o text_to_video_styled) e la chiamata restituisce 202 Accepted con un id del job; interroga GET /videos/generations/{id} per il risultato. Controlla GET /videos/models per il supporto di ciascun engine a duration, resolution, aspect_ratio, frame finale e audio.

Esempio: image-to-video con frame iniziale e finale

In modalità image_to_video, image è il frame iniziale ed end_image un frame finale facoltativo (solo sugli engine che supportano il frame finale — vedi supports_end_frame in GET /videos/models). Ogni frame accetta esattamente uno tra image_id, url, oppure base64 + mime_type.
duration è obbligatorio e deve essere uno tra quelli supportati dall’engine (vedi durations in GET /videos/models) — un valore non supportato restituisce 422. Per text_to_video_styled, style_id è obbligatorio insieme a prompt e duration; il menu a tendina del corpo della richiesta qui sopra mostra tutte e tre le modalità.

Autorizzazioni

Authorization
string
header
obbligatorio

Organization API key as a bearer token: Authorization: Bearer samsa_sk_....

Corpo

application/json

mode: image_to_video — animate a start frame (optional end frame).

duration
integer
obbligatorio

Clip length in seconds. Each engine supports a specific set — see durations in GET /videos/models. Unsupported values return 422.

Esempio:

8

image
PublicVideoFrame · object
obbligatorio

The start frame: exactly one of image_id, url, or base64+mime_type.

engine
string | null

Video engine — a public engine id from GET /videos/models (e.g. veo_3_1_lite, the default). Unknown engines return 422.

Esempio:

"veo_3_1_lite"

aspect_ratio
string
predefinito:16:9

Aspect ratio — 16:9, 9:16, or 1:1 (engine-dependent; see aspect_ratios in GET /videos/models).

Esempio:

"16:9"

resolution
string | null

Output resolution — 720p, 1080p, or 4k where the engine supports it (see resolutions in GET /videos/models). Omit to use the engine default. Credits scale with the engine's resolution multipliers.

Esempio:

"720p"

generate_audio
boolean
predefinito:false

Generate audio with the video — audio-capable engines only (see supports_audio in GET /videos/models); adds the engine's audio credit multiplier.

Esempio:

false

webhook_url
string | null

Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs).

Esempio:

"https://example.com/webhooks/samsa"

mode
string
predefinito:image_to_video
Allowed value: "image_to_video"
end_image
PublicVideoFrame · object | null

Optional end frame — only for end-frame-capable engines (see supports_end_frame in GET /videos/models).

prompt
string | null

Optional text prompt guiding the motion.

Minimum string length: 1
Esempio:

"The camera slowly pans right as waves roll in"

Risposta

Successful Response

202 body for POST /videos/generations (ADR §7.1).

id
string<uuid>
obbligatorio

The video job id — poll GET /videos/generations/{id}.

status
enum<string>
obbligatorio

Initial status: always pending at submit.

Opzioni disponibili:
pending,
processing,
completed,
failed,
cancelled
Esempio:

"pending"

mode
string
obbligatorio

The requested mode — image_to_video, text_to_video, or text_to_video_styled.

Esempio:

"text_to_video"

estimated_credits
integer
obbligatorio

Credits this job is expected to cost (base 5/sec x engine multiplier x resolution x audio; styled adds a flat 10 for the intermediate image).

Esempio:

80