Skip to content

API Reference

Sandcut keeps the public API deliberately small.

Authentication

All processing requests require a bearer token.

http
Authorization: Bearer <token>

Endpoints

EndpointMethodPurpose
/healthGETBasic health response
/docGETHuman-readable metadata
/openapi.jsonGETTooling-friendly schema
/video/processPOSTMedia processing entrypoint

POST /video/process

Request body

json
{
  "input_url": "https://example.com/video.mp4",
  "ffmpeg_args": ["-vf", "scale=640:360", "-c:v", "libx264", "-c:a", "aac"],
  "seek": {
    "mode": "hybrid",
    "start": 30,
    "duration": 8
  }
}

Multiple input files

Use inputs when FFmpeg needs more than one remote file source.

json
{
  "inputs": [
    "https://example.com/intro.mp4",
    "https://example.com/main.mp4"
  ],
  "ffmpeg_args": [
    "-filter_complex",
    "[0:v][1:v]concat=n=2:v=1:a=0[v]",
    "-map",
    "[v]"
  ]
}

Use either input_url or inputs, not both.

seek object

FieldTypeRequiredNotes
modestringnofast, accurate, or hybrid; defaults to accurate
startnumberyesnon-negative start time in seconds
durationnumbernoclip length in seconds
endnumbernoalternative to duration; must be greater than start

Use either duration or end, not both.

Success response

json
{
  "success": true,
  "outputUrl": "https://cdn.example.com/output/20260313/uuid.mp4",
  "size": 395768,
  "sizeKnown": true,
  "input": {
    "size": 8212301,
    "sizeKnown": true,
    "probeMethod": "HEAD"
  },
  "seek": {
    "mode": "hybrid",
    "startSeconds": 30,
    "durationSeconds": 8
  },
  "timing": {
    "total": 4972,
    "container": 3819,
    "upload": 771
  }
}

For multi-input requests, the response also includes an inputs array with per-input probe metadata.

Error envelope

json
{
  "error": {
    "code": 3003,
    "message": "Video size exceeds limit",
    "details": "Input is 300000000 bytes, limit is 209715200 bytes"
  }
}

Validation rules

  • input_url must be http or https
  • inputs can contain 1 to 8 remote input URLs
  • private IPs, localhost, and internal metadata domains are rejected
  • ffmpeg_args cannot include nested input flags such as -i
  • raw seek overrides such as -ss and -to are rejected from ffmpeg_args
  • dangerous protocol prefixes such as pipe: and file: are rejected
  • global seek is only supported for single-input requests

Schema

Use the static schema in /openapi.json for client generation or API catalog tooling.

Built for sandboxed media workloads on Cloudflare.