# How to add video editing to your app

> Make a cuttingfloor API key, then have your backend call its REST API, one POST /v1/<tool> per edit: import your user’s video, cut it, caption it, add music, export it. Your users upload straight from their browser or phone, your key stays on your server, and each finished video comes back as an MP4 link.

Canonical: https://cuttingfloor.ai/guides/add-video-editing-to-your-app · Updated: 2026-11-28 · Index: https://cuttingfloor.ai/llms.txt

## How

1. **Make an API key.** Sign up free and make a key on your account page (it starts with cf_). Keep it on your server: every call acts as your account and uses its credits, so your users never need a cuttingfloor account.
2. **Get your user’s video in.** Your backend calls media.upload for a one-time upload URL, and your user’s browser or app sends the file to it with a PUT, no key needed. Then media.import with {"source": {"upload_id": …}} brings it in. A file already online imports from its URL.
3. **Edit with one call per change.** timeline.create starts a vertical or wide timeline; clip.add, clip.trim, caption.add, audio.set_gain, transition.add and the rest each make one edit and return a new timeline_id, so undo is going back to the old one. media.analyze gives a transcript with word times to cut or caption by, and render.frames shows the result.
4. **Export and hand it back.** export.video answers with a job_id; job.get waits for it and gives a download link and a watch page. The review copy carries a cuttingfloor watermark and is free; the clean copy spends credits once, priced by length. Store the files you keep: links last 7 days.

## What to type

```
Add video editing to my app with the cuttingfloor REST API (OpenAPI spec: https://api.cuttingfloor.ai/openapi.json). Read the key from CUTTINGFLOOR_KEY, on the server only. Let a user upload a video from the browser (media.upload, PUT the file to its url, then media.import with the upload_id), add captions from the transcript, make it vertical, export an MP4 and show them the download link.
```

## Call it

### REST API in your app

Call cuttingfloor from your own product like any other web service: your backend sends POST https://api.cuttingfloor.ai/v1/<tool> with the arguments as JSON and gets the result back as JSON, with real HTTP status codes when a call is refused. Long work (imports, renders, exports) answers at once with a job_id that job.get waits on. The OpenAPI spec feeds code generators and API clients.

```
curl https://api.cuttingfloor.ai/v1/timeline.create \
  -H 'Authorization: Bearer cf_…' \
  -H 'Content-Type: application/json' \
  -d '{"name": "First edit", "sequence": {"width": 1080, "height": 1920, "fps": {"num": 30, "den": 1}}}'
```

### Code execution

An LLM writes code that calls the same API from a sandbox, and chains many edits in one run instead of spending a turn on each tool call. It reads only the tools it needs rather than loading every tool’s schema, and keeps big results in variables instead of its context. The sandbox only has to reach https://api.cuttingfloor.ai with your key.

```
import os, requests

API = "https://api.cuttingfloor.ai/v1"
KEY = os.environ["CUTTINGFLOOR_KEY"]

def cf(tool, **args):
    r = requests.post(f"{API}/{tool}", json=args,
        headers={"Authorization": f"Bearer {KEY}"})
    body = r.json()
    if not r.ok:
        raise RuntimeError(body.get("hint") or body["message"])
    return body

t = cf("timeline.create", name="First edit",
    sequence={"width": 1080, "height": 1920,
              "fps": {"num": 30, "den": 1}})
print(t["timeline_id"])
```

- [How to connect](https://cuttingfloor.ai/how-to-connect#builders)

## What can my app do with it?

What a video editor does, one call each: cut, trim, split, speed, captions with highlighted words, titles, overlays, masks, colour, transitions, audio levels and fades, music made for the video, sound effects, voiceovers, background removal and stabilising. Out come MP4, ProRes, GIF, WAV or MP3, and FCPXML, OTIO, EDL, SRT or VTT for other editors.

## Do my users need a cuttingfloor account?

No. Your server calls with your key, so everything runs on your account and its credits. Never put the key in a web page or a phone app: have your backend make the calls and hand your users only upload and download links.

## How do I know when an export is done?

Long work (imports, analysis, renders, exports) answers at once with a job_id. POST /v1/job.get with {"job_id": "…", "wait_seconds": 30} waits up to 30 seconds and gives the result and signed download links when it finishes. A refused call answers with an HTTP error status and {code, message, hint}.

## Can my app show the timeline?

Yes. timeline.get returns the whole timeline as JSON (tracks, clips, times in frames), so your app can draw its own. render.frames returns pictures of any frame, and a short export with the mp4_h264_fast preset plays a range with sound.

## How long are files kept?

On the hosted server, media and exports are kept 7 days, timelines 24 hours after last use. Download links last 7 days, so store the finished files you want to keep on your side.

## What does it cost?

Editing is free: every import, edit, preview and export, as many times as you like. Each export gives a free review copy with a cuttingfloor watermark and a clean copy that spends credits once, when it is first opened or released with export.release, priced by the video’s length. A new account gets 3 credits when you activate it; after that, credit packs that never expire, on the pricing page.

## Can I run it on my own servers?

Yes. cuttingfloor is open source and ships as one Docker image, the same server as the hosted one with the same REST API and OpenAPI spec. See Run it yourself (/self-host).
