> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creatok.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video cleaning

> Remove burned-in subtitles from a selected area or remove a watermark from the full frame.

Video cleaning creates an asynchronous job. Use `POST /videos/remove-subtitles` to process a selected area or `POST /videos/remove-watermarks` to process the full frame. Both endpoints use your API wallet and return the same Job resource as other video operations.

## Before you start

Create an [organization API key](https://docs.creatok.ai/guides/authentication.md). Upload the source video with [`POST /files`](https://docs.creatok.ai/guides/files) and complete the multipart upload before submitting a cleaning request. Pass the returned `file_id` or `upload_fields.key` as `input.video`. The file must belong to your workspace. Public URLs and arbitrary storage paths are not accepted.

The cleaner accepts MP4, MOV, AVI, WebM, and MKV videos from 1 to 60 seconds, up to 50 MiB. The upload grant allows larger videos, so keep cleaning inputs within the 50 MiB endpoint limit. The server checks the uploaded file's actual type, size, duration, and dimensions.

## Remove subtitles from a selected area

Pass `selected_area` with normalized coordinates from `0` to `1`. The origin `(0, 0)` is the top-left corner. `x` and `y` locate the area's upper-left corner; `width` and `height` define its size. The rectangle must stay within the frame and cover at least one pixel.

```bash theme={null}
export CREATOK_API_KEY="cok_..."
export CREATOK_IDEMPOTENCY_KEY="$(uuidgen)"

curl --fail-with-body --include https://api.creatok.ai/v1/videos/remove-subtitles \
  -H "Authorization: Bearer $CREATOK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $CREATOK_IDEMPOTENCY_KEY" \
  --data '{
    "input": {
      "video": "file_11111111-1111-4111-8111-111111111111",
      "selected_area": { "x": 0, "y": 0.8, "width": 1, "height": 0.2 }
    },
    "metadata": { "client_reference": "order-123" }
  }'
```

The example selects the bottom fifth of the frame. Adjust the rectangle to cover the burned-in subtitles. This operation processes only that area.

## Remove a watermark

Pass only the uploaded source video. The operation processes the full frame.

```bash theme={null}
curl --fail-with-body --include https://api.creatok.ai/v1/videos/remove-watermarks \
  -H "Authorization: Bearer $CREATOK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $CREATOK_IDEMPOTENCY_KEY" \
  --data '{
    "input": {
      "video": "file_11111111-1111-4111-8111-111111111111"
    },
    "metadata": { "client_reference": "order-123" }
  }'
```

## Request fields

Both requests accept optional `metadata` and `max_cost_usd` at the request root. `max_cost_usd` is a spending cap written as a nonnegative decimal string with up to six decimal places. The request is rejected before charging when its quote exceeds the cap. Neither endpoint accepts a `model` field or client-supplied duration, dimensions, or file size.

See the [API console pricing page](https://www.creatok.ai/app/api-platform/pricing) for current rates.

## Read the job

The endpoint returns HTTP `202` with a Job resource directly. A `202` response can already have `status: "failed"`, so inspect the status. While a job is `queued` or `running`, wait for `Retry-After` seconds before polling [`GET /jobs/{jobId}`](https://docs.creatok.ai/api-reference/retrieve-a-job). On success, download the result from `output.files`. Signed output URLs expire after about one hour; retrieve the job again for a fresh URL. Outputs are removed 48 hours after completion.

Reuse the same `Idempotency-Key` and exact request body after a timeout or connection failure. A retry returns the original job without creating another task. If you change the request, use a new key. Reusing a key with a different request returns `409 idempotency_key_reused`.

See [Jobs and polling](https://docs.creatok.ai/guides/jobs.md) for job fields and refunds, and [Errors](https://docs.creatok.ai/guides/errors.md) for HTTP error handling.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.