# Video · edit (Replace)

`POST /v1/videos/edits` — Edit a clip you bring: swap a character, an outfit, the place or the style — the motion, timing and camera stay.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: 8 credits / second (eroq-replace) · 74 credits / second (eroq-replace-pro, 2 s minimum)

**eroq Replace** edits YOUR clip. `mode: "swap"` changes one thing and keeps the rest of the shot (a character, an outfit, a product, the location, the weather, the style); `mode: "recast"` keeps the performance, the timing and the camera movement and rebuilds the subjects, the set and the look from your words. The result keeps the source's length and framing, lands in your library, and is polled like any render (GET /v1/videos/generations/{id}).

`source` is a media key you own: `upload:<id>` (a file in POST /v1/uploads) or `creation:<id>` (a clip in your library). It must be an MP4 or MOV; its length is measured on our side and billed per second: **`eroq-replace`** takes 1–15 s and returns up to 720p; **`eroq-replace-pro`** (Creator plan and up) takes 2–30 s, returns up to 1080p and accepts up to 5 `keyframes` — pictures the result should match at their timestamps. Trim and convert longer clips first (the studio does it in the browser).

`@mentions` of your characters and elements in `prompt` (their ids in `elements`) ride as their names and looks. To put your own character into the shot on Replace Pro, make a keyframe: paint them into the clip's first frame with POST /v1/images/generations (the frame as a reference, the character in `elements`), then pass that picture as `keyframes: [{ "image": "creation:<id>", "seconds": 0 }]`. Moderated upstream — SFW work only; a declined edit is refunded.

## POST /v1/videos/edits

Edit a clip you bring: swap a character, an outfit, the place or the style — the motion, timing and camera stay.

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `source` | string | yes | The clip to edit: `upload:<id>` or `creation:<id>` — MP4/MOV, 1–15 s (Replace) or 2–30 s (Replace Pro). |
| `prompt` | string | yes | What changes — "Replace the man with @Mina", "Make it snow". Up to 2000 characters. |
| `model` | string | no | `eroq-replace` (default) or `eroq-replace-pro`. |
| `mode` | string | no | `swap` (default) or `recast`. |
| `elements` | array | no | Ids of the characters (`char:<id>`) and elements you @mention. |
| `keyframes` | array | no | Replace Pro: up to 5 `{ image: "upload:<id>" \| "creation:<id>", seconds }` pictures to match. |
| `seed` | integer | no | Replace Pro: reproducibility seed. |
| `store` | boolean | no | Persist the result at a permanent public URL (charged at the Store's rate). |

### Example request

```bash
curl https://eroq.ai/v1/videos/edits \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "eroq-replace",
  "source": "upload:9f2c41ab77d0e1c3",
  "prompt": "Make it snow heavily, snow settling on everything",
  "mode": "swap"
}'
```

```javascript
const res = await fetch('https://eroq.ai/v1/videos/edits', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EROQ_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "model": "eroq-replace",
    "source": "upload:9f2c41ab77d0e1c3",
    "prompt": "Make it snow heavily, snow settling on everything",
    "mode": "swap"
  }),
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post(
    "https://eroq.ai/v1/videos/edits",
    headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"},
    json={
        "model": "eroq-replace",
        "source": "upload:9f2c41ab77d0e1c3",
        "prompt": "Make it snow heavily, snow settling on everything",
        "mode": "swap"
    },
)
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "model": "eroq-replace",
  "source": "upload:9f2c41ab77d0e1c3",
  "prompt": "Make it snow heavily, snow settling on everything",
  "mode": "swap"
}`)

	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/videos/edits", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "id": "c41e9a07-…",
  "object": "video.edit",
  "created": 1759068000,
  "status": "processing",
  "model": "eroq-replace",
  "duration": "4s",
  "poll": "/v1/videos/generations/c41e9a07-…",
  "usage": { "credits_spent": 32, "credits_remaining": 530 }
}
```

---
Canonical: https://eroq.ai/docs/video-edits · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
