Skip to content

Generate

Clip edits

POST /v1/videos/edits: swap the people in a clip you send for your faces, or upscale it.

POST/v1/videos/editsFetches the clip and the faces, holds the price of the longest clip, starts the edit and answers 202 with the generation to poll, its hold brought down to the clip's length.
GET/v1/videos/edits/{id}The generation, moved forward if it is still running (the same as GET /v1/videos/generations/{id}).

The clip editors: Frameport Replace 1 (fp-replace-1, face swap) and Frameport Upscale 1 (fp-upscale-1, upscale). A clip editor is called here only; the generation endpoints refuse it, and this one refuses a model that renders from a prompt.

Body

FieldTypeNotes
modelstringRequired. A clip editor: fp-replace-1 and fp-upscale-1.
videostringRequired. The clip: a public https URL we download, one of your video outputs (file_…) or a video upload (upl_…).
resolutionstringOne of the model's options.resolutions. Its default_resolution when left out.
facesstring[]Required by Frameport Replace 1, refused by the others: one picture per person replaced, left to right, up to 4. An https URL, a base64 data URI, one of your image outputs (file_…) or an image upload (upl_…): PNG, JPEG or WebP, up to 10 MB each.
targetsstring[]Who each face replaces, in the same order ("the woman on the left"), up to 200 characters each. Required with several faces.
keep_outfitbooleanDefault true: the clip's clothes stay. false dresses each person as in their picture.
promptstringOptional, up to 500 characters: a note on the edit.
max_cost_usdnumberThe most this edit may hold, in USD: the price of the longest clip the model takes. Above it, 400 max_cost_exceeded before anything is fetched or held.

A field the model does not take, or a value off its limits, is refused with 400 invalid_request before anything is fetched or held. Send an Idempotency-Key header to retry safely (Idempotency).

curl https://frameport.ai/v1/videos/edits \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fp-replace-1",
    "video": "https://example.com/dance.mp4",
    "faces": [
      "https://example.com/me.jpg"
    ]
  }'
202 Accepted
{
  "id": "gen_6Pq3WnT8vXc1Lm5Rk9YbZs",
  "object": "generation",
  "type": "video",
  "model": "fp-replace-1",
  "status": "queued",
  "input": {
    "video": "url",
    "resolution": "768p",
    "faces": 1,
    "keep_outfit": true,
    "duration": 6
  },
  "reserved_usd": 0.72,
  "cost_usd": null,
  "outputs": [
    {
      "id": "file_3Vb8KqW2nTx7Lc5Rm1YdPs",
      "status": "queued"
    }
  ],
  "error": null,
  "created_at": "2026-11-27T10:00:00.000Z",
  "completed_at": null
}
Frameport Upscale 1
{
  "model": "fp-upscale-1",
  "video": "file_8Hc2RkQw5ZpT1mVb7nXe3L",
  "resolution": "2K"
}

The clip

  • A URL must be https on a public host name (no IP address, no private or local host), without credentials: we download it ourselves and follow up to 3 redirects, each checked the same way.
  • A file id must be one of your workspace's finished video outputs (an image output for a face); an upload id, one of its uploads, a clip for video, a picture for a face.
  • Frameport Replace 1: MP4 or MOV, up to 64 MB, 24 fps, 2 to 10 seconds.
  • Frameport Upscale 1: MP4 or MOV, up to 100 MB, 900 frames at most, 1 to 30 seconds (5 s billed at least).
  • A clip the model cannot use (it cannot be downloaded, it is not a video, or it is off the model's limits once measured) is refused with 400 invalid_video when you send it, and the message says why: nothing is charged.

Price

An edit costs per_second[resolution] × the clip's length in whole seconds, rounded up (0.15 s over is not counted), never under edit.min_billed_seconds. The price of the longest clip the model takes (edit.max_seconds) is held first; once the clip is measured, the hold comes down to its price, which is the reserved_usd of the 202. It is charged when the edit succeeds; a failed edit costs nothing.

A failed edit

An edit that fails after the 202 shows on the generation like any other: status: "failed", error says why, and cost_usd is 0: the hold went back to the balance.

Each model page lists its resolutions, its prices and its limits, with a request body to copy.