Home / APIs / FFmpeg API

FFmpeg API for Developers

FatBaby exposes FFmpeg power in two ways: preferred allowlisted Media Processing routes under /v1/video, /v1/audio, and /v1/gif; and a legacy /v1/render workflow where you create a job folder, upload inputs, and start a validated ffmpeg command.

Features

What this API actually supports in production today.

  • Preferred: structured media endpoints (no raw filters)
  • Legacy: create job → upload → render → poll → download
  • Path sandboxing for legacy commands
  • Shared credit wallet and API key
  • Job status polling and authenticated downloads

Common use cases

  • Teams that want safe video ops without shell access
  • Migrations from self-hosted ffmpeg wrappers
  • Custom encode pipelines using the legacy render path

API endpoints

Base URL https://thefatbaby.com/api. Authenticate with Authorization: Bearer fb_live_YOUR_KEY.

MethodPathSummaryCredits
POST/v1/video/compressPreferred media compressDuration-based
POST/v1/render/jobCreate legacy render job1 credit
POST/v1/render/upload/:jobIdUpload input file2 credits
POST/v1/render/renderStart validated ffmpeg command5 credits when accepted
GET/v1/render/status/:renderJobIdPoll legacy render0 credits
GET/v1/render/download/:jobId/:filenameDownload output0 credits

Examples

Primary endpoint /v1/render/job · Legacy path: 1 + 2 per upload + 5 to start render. Prefer /v1/video/* when an allowlisted op fits.

cURL

curl -X POST https://thefatbaby.com/api/v1/render/job \
  -H "Authorization: Bearer fb_live_YOUR_KEY"
# upload, then:
curl -X POST https://thefatbaby.com/api/v1/render/render \
  -H "Authorization: Bearer fb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"job_id":"JOB_ID","command":"ffmpeg -y -i .../input/clip.mp4 .../output/out.mp4"}'

JavaScript

const job = await fetch('https://thefatbaby.com/api/v1/render/job', {
  method: 'POST',
  headers: { Authorization: 'Bearer fb_live_YOUR_KEY' }
}).then(r => r.json());
// upload via multipart to /v1/render/upload/${job.job_id}
// start with POST /v1/render/render { job_id, command }

Python

import requests
HDR = {'Authorization': 'Bearer fb_live_YOUR_KEY'}
job = requests.post('https://thefatbaby.com/api/v1/render/job', headers=HDR).json()
# then upload + render with validated paths inside the job folders

Request

{
  "job_id": "JOB_ID",
  "command": "ffmpeg -y -i /path/to/job/input/clip.mp4 /path/to/job/output/out.mp4"
}

Response

{
  "render_job_id": "...",
  "status": "queued"
}

Pricing & credits

Legacy render charges per create/upload/start step. Media routes charge by operation duration.

Common errors

  • 400Command path escapes job folders or invalid args
  • 402insufficient_credits
  • 404Unknown job id

FAQ

Which path should I use?

Prefer /v1/video, /v1/audio, and /v1/gif for standard transforms. Use legacy /v1/render only when you need a custom validated ffmpeg command.

Is arbitrary shell allowed?

No. Only ffmpeg commands with paths confined to the job directories are accepted.

Try without code

Use the matching online tool, then automate the same workflow with this API.