Skip to main content
POST
/
ffmpeg
/
trim
curl --request POST \
  --url https://api.varg.ai/v1/ffmpeg/trim \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://s3.varg.ai/o/my-video.mp4",
  "start": 5,
  "end": 15
}
'
{
  "job_id": "job_a1b2c3d4",
  "status": "completed",
  "model": "fal:kling-v2.5",
  "created_at": "2026-02-13T10:00:00Z",
  "completed_at": "2026-02-13T10:02:30Z",
  "output": {
    "url": "https://s3.varg.ai/o/job_a1b2c3d4.mp4",
    "media_type": "video/mp4"
  },
  "cache": {
    "hit": false,
    "key": "sha256:abc123..."
  },
  "error": "Provider returned an error"
}

Authorizations

Authorization
string
header
required

API key from varg.ai/dashboard.

Pass as Authorization: Bearer varg_xxx.

Body

application/json
url
string<uri>
required

URL of the source video

Example:

"https://s3.varg.ai/o/my-video.mp4"

start
number
required

Start time in seconds

Required range: x >= 0
Example:

5

end
number

End time in seconds (mutually exclusive with duration)

Required range: x >= 0
Example:

15

duration
number

Duration in seconds (mutually exclusive with end)

Required range: x >= 0
precise
boolean
default:false

Frame-accurate cuts (re-encodes) vs fast keyframe-aligned

Response

Job created

job_id
string
required

Unique job identifier

Example:

"job_a1b2c3d4"

status
enum<string>
required

Current job status

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

"completed"

model
string
required

Resolved model identifier (provider:model format)

Example:

"fal:kling-v2.5"

created_at
string<date-time>
required

When the job was created

Example:

"2026-02-13T10:00:00Z"

completed_at
string<date-time>

When the job finished (completed, failed, or cancelled)

Example:

"2026-02-13T10:02:30Z"

output
object

Job output, present when status is completed

cache
object

Cache metadata

error
string

Error message, present when status is failed

Example:

"Provider returned an error"