Skip to main content

api

title: Video API description: Generative video APIs for Business Applications sidebar_position: 1 slug: /video

Video API

  • Base URL: https://api.samsar.one/v1
  • Auth: Authorization: Bearer <API_KEY>
  • Content-Type: application/json

Pricing

Credits are charged per rendered second based on the chosen video_model. If image_model is HUNYUAN, the charge is multiplied by 1.5x.

video_modelCredits / sec
VEO3.1I2VFAST30
SORA230
VEO3.1I2V60
KLINGIMGTOVIDTURBO15
SORA2PRO70
All other express models10

Formula
credits = duration_seconds × credits_per_sec × (image_model === HUNYUAN ? 1.5 : 1)

Example: 45s video on RUNWAYML with SEEDREAM45 × 10 = 450 credits.

POST /video/create

Submit a prompt-only request to start video generation. Webhooks are optional.

Request body

{
"input": {
"prompt": "Required text, max 1000 chars",
"image_model": "GPTIMAGE1 | IMAGEN4 | SEEDREAM | HUNYUAN | NANOBANANA",
"video_model": "RUNWAYML | SEEDANCEI2V | HAILUO | HAILUOPRO | WANI2V | WANI2V5B | VEO3.1I2V | VEO3.1I2VFAST | KLINGIMGTOVIDTURBO | SORA2 | SORA2PRO",
"duration": 30,
"tone": "grounded | cinematic",
"aspect_ratio": "16:9 | 9:16",
"video_model_sub_type": "anime | 3d_animation | clay | comic | cyberpunk"
},
"webhookUrl": "https://example.com/webhook"
}
  • prompt, image_model, video_model, duration are required; duration ≤ 240 seconds.
  • video_model_sub_type is optional and must be one of the listed values when provided.

Sample request

curl -X POST https://api.samsar.one/v1/video/create \
-H "Authorization: Bearer $SAMSAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A timelapse of clouds over a futuristic city at sunrise",
"duration": 30,
"image_model": "IMAGEN4",
"video_model": "RUNWAYML",
"tone": "grounded",
"aspect_ratio": "16:9"
}
}'

Success response (200)

{
"request_id": "vid_a1b2c3d4",
"session_id": "vid_a1b2c3d4"
}

Error responses

  • 400 invalid or missing fields (empty prompt, unsupported models, duration > 240, etc.)
  • 401 invalid API key

GET /status

Poll the status for any request_id returned by /video/create.

Request

curl "https://api.samsar.one/v1/status?request_id=vid_a1b2c3d4" \
-H "Authorization: Bearer $SAMSAR_API_KEY"

Queued / processing

{
"session_id": "vid_a1b2c3d4",
"request_id": "vid_a1b2c3d4",
"status": "PENDING",
"type": "video",
"provider": "RUNWAYML"
}

Completed

{
"session_id": "vid_a1b2c3d4",
"request_id": "vid_a1b2c3d4",
"status": "COMPLETED",
"type": "video",
"provider": "RUNWAYML",
"result_url": "https://cdn.samsar.one/videos/vid_a1b2c3d4.mp4"
}
  • result_urls may be present when multiple assets are produced.
  • 404 is returned when the request_id is unknown; 401 when the API key is invalid.