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

Video Models

NameKey
Runway Gen‑4 (Default)RUNWAYML
Hailuo Img2VidHAILUO
Kling 2.1 ProKLINGIMGTOVID2.1PRO
SeeDance I2VSEEDANCEI2V

Pricing

Per‑second rates

Model / ItemCredits / secNotes
All models10Applies to every model supported by API.

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 (≤ 500 characters)YesText prompt that drives image & video generation.
durationnumber seconds (≤ 120)No30Desired video length.
image_modelstring GPTIMAGE1 | IMAGEN4NoGPTIMAGE1Key for the underlying image‑generation model.
video_modelstring RUNWAYML | KLINGIMGTOVID2.1PRO | SEEDANCEI2V | HAILUONoRUNWAYMLKey for the video‑synthesis engine.
tonestring grounded | cinematicNogroundedOverall stylistic tone of the output.
aspect_ratiostring 9:16 | 16:9No16:9Aspect ratio of the result

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": "KLINGIMGTOVID2.1PRO",
"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"
}