Skip to main content

API Docs

Authentication

Header (required)

Authorization: Bearer YOUR_API_KEY

Create and manage API keys in your dashboard. Register for an account and create an API key from account settings here.

CodeReason
400Missing or empty API_KEY header
401Invalid API_KEY

Supported Models

Image Models

NameKey
GPT Image 1GPTIMAGE1
Imagen 4IMAGEN4
SeedreamSEEDREAM
NanoBananaNANOBANANA
Hunyuan V3HUNYUAN

Video Models

NameKey
Runway Gen-4 (Default)RUNWAYML
SeeDance I2VSEEDANCEI2V
Hailuo Img2VidHAILUO
Hailuo ProHAILUOPRO
Wani I2VWANI2V
Wani I2V 5BWANI2V5B
Veo3.1 I2VVEO3.1I2V
Veo3.1 I2V FastVEO3.1I2VFAST
Kling I2V Turbo ProKLINGIMGTOVIDTURBO
Sora 2SORA2
Sora 2 ProSORA2PRO

Pricing

Per-second rates

Model / ItemCredits / secNotes
Default (all other)10Base rate for most video generation models.
Kling I2V Turbo Pro15Kling I2V 2.5 SoTA model.
Veo3.1 I2V Fast30Higher-tier accelerated model.
Sora 230Advanced Sora model with fast turnaround.
Veo3.1 I2V60Premium Veo3 model with higher fidelity.
Sora 2 Pro70Highest fidelity Sora with extended capabilities.

Image-model multiplier

If you select the Hunyuan image model, a multiplier applies to the video rate:

  • Hunyuan (HUNYUAN): ×1.5 on the per-second video rate

Effective credits formula

effective_credits = duration_seconds
× video_rate_credits_per_sec
× (image_model == HUNYUAN ? 1.5 : 1)

Example

60-second video with KLINGIMGTOVIDTURBO (15 cr/s)

  • With SEEDREAM: 60 × 15 × 1 = 900 credits
  • With HUNYUAN: 60 × 15 × 1.5 = 1,350 credits

Subscription plan

PlanIncluded credits / moNotes
Creator Plan$49.99 5 000 creditsBilled monthly
Individual credits can also be purchased from the website $10/1000 credits.

Endpoints

POST /create

Creates a new video-generation session.

Request Body Parameters

FieldType & ConstraintsRequiredDefaultDescription
promptstring (≤ 1000 characters)YesText prompt that drives image & video generation.
durationnumber seconds (≤ 180)No30Desired video length.
image_modelstring one of: GPTIMAGE1IMAGEN4SEEDREAMNANOBANANA
video_modelstring one of: RUNWAYMLSEEDANCEI2VHAILUOHAILUOPRO
tonestring groundedcinematicNogrounded
aspect_ratiostring 9:1616:9No16:9

Example Request

curl -X POST https://api.samsar.one/v1/video/create \
-H "Authorization: Bearer 74c4bbbee28e7e221330e48c2cdd897acad510" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "An astronaut cat exploring a neon-lit Mars colony",
"duration": 30,
"image_model": "IMAGEN4",
"video_model": "SORA2",
"tone": "grounded",
"aspect_ratio": "16:9"
}
}'

Successful Response

{
"request_id": "vid_1234567890"
}
CodeReason
201Session created
400Validation error
401Authentication error

Failure Response (Example)

{
"message": "Invalid movie prompt."
}

GET /status

Fetches the current state of a generation session.

Query Parameters

ParamTypeRequiredDescription
request_idstringYesIdentifier returned by /create.

Example Request

curl -X GET "https://api.samsar.one/v1/video/status?request_id=vid_1234567890" \
-H "Authorization: Bearer YOUR_API_KEY"

Possible Responses

ScenarioExample PayloadCode
Processing / PendingSee below200
Completed{ "video_link": "https://cdn.samsar.one/videos/vid_1234567890.mp4" }200
Invalid request{ "message": "Missing or invalid session_id." }400
Not found404
Authentication error401
Pending Payload Structure
{
"status": "PENDING",
"details": {
"prompt_generation": "COMPLETED",
"image_generation": "COMPLETED",
"audio_generation": "COMPLETED",
"frame_generation": "INIT",
"video_generation": "INIT",
"ai_video_generation": "PENDING",
"speech_generation": "COMPLETED",
"music_generation": "COMPLETED",
"lip_sync_generation": "INIT",
"sound_effect_generation": "INIT",
"transcript_generation": "INIT"
}
}
Success Payload Structure
{
"status": "COMPLETED",
"url": "https://cdn.samsar.one/videos/vid_1234567890.mp4"
}

Notes on Pricing Calculation (for reference)

Your internal calculation (credits) aligns with the table above:

// Pseudocode equivalence:
//
// perSec = 0.1 (default)
// VEO3I2VFLASH => 0.3
// VEO3I2V => 0.6
// KLINGIMGTOVIDTURBO => 0.15
// SORA2 => 0.3
// SORA2PRO => 0.7
// if HUNYUAN image model => ×1.5
// totalCredits = durationSeconds * perSec * 100 * (HUNYUAN ? 1.5 : 1)