# Skill: effect/before-after — "לפני / אחרי" (Before / after slider)

A slider sweeps between the “before” and the “after” (photos or clips) with a handle and labels.
סליידר נע בין ה״לפני״ ל״אחרי״ (תמונות או סרטונים) עם ידית ותוויות.

Category: Overlays & graphics · שכבות וגרפיקה · a real preview: https://media.gpt.org.il/lookbook/effects/before-after.mp4?v=mv19exzc
Price: **60 credits per finished minute**: the render itself — 1 credit per second of 1080p output. Combined with captions, a hook or other effects: still one render, nothing more for combining.

Base URL: `https://apihub.co.il` · Auth: `Authorization: Bearer <API key>` · Docs: `/docs` (group "Video Effects")
Send `X-Tag: <job name>` on every call of one video; `GET /v1/usage?tag=<job name>` returns what it cost.
**Files are kept 24 hours** — download the finished video.

---

## 1. On its own — one call

```jsonc
POST /v1/effects/before-after             // x-wait-ms: 110000
{
  "start": 0,
  "duration": 4.6,
  "params": {
    "before_url": "https://media.gpt.org.il/lookbook/effects/assets/photo-car.jpg",
    "after_url": "https://media.gpt.org.il/lookbook/effects/assets/photo-car-graded.jpg"
  }
}
```

A normal render: `status: processing` → poll `GET /v1/executions/{id}` until `completed`, then read `output.url`.

When it plays: a stretch: `start` + `duration` (seconds of the finished video), or `at` (a word id) + `duration`, or `during` { from, to } (word ids).

## 2. With captions, a hook and other effects — the same render

```jsonc
POST /v1/studio/edit               // x-wait-ms: 110000
{
  "video_url": "<the video>",
  "language_code": "he",
  "captions": {
    "style": "classic"
  },
  "effects": [
    {
      "id": "before-after",
      "params": {
        "before_url": "https://media.gpt.org.il/lookbook/effects/assets/photo-car.jpg",
        "after_url": "https://media.gpt.org.il/lookbook/effects/assets/photo-car-graded.jpg"
      },
      "start": 0,
      "duration": 4.6
    }
  ],
  "audio": {
    "normalize": true
  },
  "output": {
    "aspect_ratio": "9:16",
    "resolution": "1080",
    "fit": "crop",
    "quality": "high"
  }
}
```

`effects` is a list: add more entries for more effects. The engine applies them by pipeline stage (cuts and time →
camera → grade and looks → overlays → text and captions → sound), never by their order in the list. An edit has one
`transition`, one `color` grade, one `music` bed, one `speed` and one caption style: two effects that set the same
one are refused with a message that names them.

## 3. Params

| param | default | range / options | what it does |
|---|---|---|---|
| `before_url` | **required** | string | The “before” photo or clip |
| `after_url` | **required** | string | The “after” photo or clip |
| `direction` | `"horizontal"` | `horizontal` · `vertical` | horizontal = side by side (after on the reading end) · vertical = before over after |
| `path` | `"in-out-in"` | `in-out-in` · `in` · `hold-middle` | in = one sweep · in-out-in = sweep, back, settle in the middle · hold-middle |
| `labels` | `["לפני","אחרי"]` | list | The two labels ("" = none) |
| `handle` | `"line+knob"` | `line+knob` · `line` | The divider alone, or with a round handle |
| `color` | `"#FFFFFF"` | string | The divider and handle |

GET `/v1/effects/before-after` returns the same as JSON (with the full body schema). Every field has a default; numbers
outside their range are refused with the field's name.
