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.
Code | Reason |
---|---|
400 | Missing or empty API_KEY header |
401 | Invalid API_KEY |
Supported Models
Image Models
Name | Key |
---|---|
GPT Image 1 | GPTIMAGE1 |
Imagen 4 | IMAGEN4 |
Seedream | SEEDREAM |
NanoBanana | NANOBANANA |
Hunyuan V3 | HUNYUAN |
Video Models
Name | Key |
---|---|
Runway Gen-4 (Default) | RUNWAYML |
SeeDance I2V | SEEDANCEI2V |
Hailuo Img2Vid | HAILUO |
Hailuo Pro | HAILUOPRO |
Wani I2V | WANI2V |
Wani I2V 5B | WANI2V5B |
Veo3.1 I2V | VEO3.1I2V |
Veo3.1 I2V Fast | VEO3.1I2VFAST |
Kling I2V Turbo Pro | KLINGIMGTOVIDTURBO |
Sora 2 | SORA2 |
Sora 2 Pro | SORA2PRO |
Pricing
Per-second rates
Model / Item | Credits / sec | Notes |
---|---|---|
Default (all other) | 10 | Base rate for most video generation models. |
Kling I2V Turbo Pro | 15 | Kling I2V 2.5 SoTA model. |
Veo3.1 I2V Fast | 30 | Higher-tier accelerated model. |
Sora 2 | 30 | Advanced Sora model with fast turnaround. |
Veo3.1 I2V | 60 | Premium Veo3 model with higher fidelity. |
Sora 2 Pro | 70 | Highest 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
Plan | Included credits / mo | Notes |
---|---|---|
Creator Plan | $49.99 5 000 credits | Billed 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
Field | Type & Constraints | Required | Default | Description |
---|---|---|---|---|
prompt | string (≤ 1000 characters) | Yes | — | Text prompt that drives image & video generation. |
duration | number seconds (≤ 180) | No | 30 | Desired video length. |
image_model | string one of: GPTIMAGE1 | IMAGEN4 | SEEDREAM | NANOBANANA |
video_model | string one of: RUNWAYML | SEEDANCEI2V | HAILUO | HAILUOPRO |
tone | string grounded | cinematic | No | grounded |
aspect_ratio | string 9:16 | 16:9 | No | 16: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"
}
Code | Reason |
---|---|
201 | Session created |
400 | Validation error |
401 | Authentication error |
Failure Response (Example)
{
"message": "Invalid movie prompt."
}
GET /status
Fetches the current state of a generation session.
Query Parameters
Param | Type | Required | Description |
---|---|---|---|
request_id | string | Yes | Identifier 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
Scenario | Example Payload | Code |
---|---|---|
Processing / Pending | See below | 200 |
Completed | { "video_link": "https://cdn.samsar.one/videos/vid_1234567890.mp4" } | 200 |
Invalid request | { "message": "Missing or invalid session_id." } | 400 |
Not found | — | 404 |
Authentication error | — | 401 |
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)