Skip to main content
POST
/
videos
/
generations
curl --request POST \
  --url https://api.samsa.ai/public/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mode": "image_to_video",
  "image": {
    "url": "https://cdn.example.com/start-frame.png"
  },
  "end_image": {
    "url": "https://cdn.example.com/end-frame.png"
  },
  "prompt": "The camera slowly pans right as waves roll in",
  "engine": "veo_3_1_lite",
  "duration": 8,
  "aspect_ratio": "16:9",
  "resolution": "720p"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "mode": "<string>",
  "estimated_credits": 123
}
Submit a video-generation job. The mode field selects the request shape (image_to_video, text_to_video, or text_to_video_styled) and the call returns 202 Accepted with a job id; poll GET /videos/generations/{id} for the result. Check GET /videos/models for each engine’s supported duration, resolution, aspect_ratio, end-frame, and audio support.

Example: image-to-video with a start and end frame

In image_to_video mode, image is the start frame and end_image an optional end frame (only on end-frame-capable engines — see supports_end_frame in GET /videos/models). Each frame takes exactly one of image_id, url, or base64 + mime_type.
curl -X POST https://api.samsa.ai/public/v1/videos/generations \
  -H "Authorization: Bearer $SAMSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "image_to_video",
    "image": { "url": "https://cdn.example.com/start-frame.png" },
    "end_image": { "url": "https://cdn.example.com/end-frame.png" },
    "prompt": "The camera slowly pans right as waves roll in",
    "engine": "veo_3_1_lite",
    "duration": 8,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }'
duration is required and must be one the engine supports (see durations in GET /videos/models) — an unsupported value returns 422. For text_to_video_styled, style_id is required alongside prompt and duration; the request body dropdown above shows all three modes.

Authorizations

Authorization
string
header
required

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

Headers

authorization
string | null

Body

application/json

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

duration
integer
required

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

Example:

8

image
PublicVideoFrame · object
required

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.

Example:

"veo_3_1_lite"

aspect_ratio
string
default:16:9

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

Example:

"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.

Example:

"720p"

generate_audio
boolean
default:false

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

Example:

false

webhook_url
string | null

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

Example:

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

mode
string
default: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
Example:

"The camera slowly pans right as waves roll in"

Response

Successful Response

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

id
string<uuid>
required

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

status
enum<string>
required

Initial status: always pending at submit.

Available options:
pending,
processing,
completed,
failed,
cancelled
Example:

"pending"

mode
string
required

The requested mode — image_to_video, text_to_video, or text_to_video_styled.

Example:

"text_to_video"

estimated_credits
integer
required

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).

Example:

80