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

# Create Video Personalization

> Creates a task that re-tells a video's speech for a specific audience and re-voices it in the original speakers' voices. Send a video and a prompt describing who the video is for.

## Personalizing a Video

Video personalization takes a finished video and re-tells it for one audience. The facts, the speakers, their voices and the timing stay as they were; the wording changes to suit the people you name in the prompt. One workout video becomes a beginner version that names every move, and one highlight package explains itself to someone watching the sport for the first time, with nothing re-shot and nobody re-recorded.

This endpoint starts the task and returns a `task_id` to poll.

> [!NOTE]
>
> Prefer the SDK for anything beyond a first call. See the [Video Personalization tutorial](https://docs.camb.ai/tutorials/video-personalization-with-sdk.md) for the full submit, poll, download and share flow in Python and TypeScript.

## What It Is For

> [card] Creator content
>
> One workout video gets a beginner version that names every move and slows the pace.

> [card] Ads in a new market
>
> The same ad introduces the brand where nobody has heard of it, and skips the introduction where they have.

> [card] Sport and live highlights
>
> One commentary track serves the lifelong fan and someone watching the sport for the first time.

> [card] Classrooms
>
> A lesson is re-pitched for a younger class, in words and examples they already know.

## Request Body

* **`prompt`** (required): who the video is for and how it should speak to them, 1 to 5000 characters.
* **`video_url`** or **`file_id`** (exactly one, and one is required): a publicly accessible video URL, or the `file_id` of a video uploaded through the Files API. The Files API is enabled per workspace; contact support if your key cannot reach it.
* **`keep_music`** (default `true`): keep the original background music under the new voiceover. Set `false` to deliver speech over silence.
* **`project_name`** and **`folder_id`** (optional): how the run is named and filed in Studio.

### Writing the Prompt

Say three things: **who is watching**, **what they already know**, and **how it should sound**. "A total beginner" beats "viewers", because the script then explains what that person would not know, while someone who trains every day needs none of it.

| The video | Prompt |
| - | - |
| A workout video | `Personalize this workout for a total beginner. Say what each move does, how it should feel, and what they can leave out on the first day.` |
| A sports highlight | `Personalize this for someone watching this sport for the first time. Say what the players are doing and why it matters, and do not assume they know the rules.` |
| A school class | `Personalize this for 10 year olds. Short sentences, simple words, and examples from things they already know, like school or games.` |

> [!WARNING]
>
> `make it better`, `professional`, or a single word like `kids` gives the system nothing to aim at. The result is a competent read of the original rather than a re-framing.

> [!NOTE]
>
> The prompt steers wording and delivery, not substance. Claims, numbers, names and anything shown on screen stay as they are, and each speaker keeps their own voice and turns.

## Request Example

```python Python SDK theme={null}
import os
from camb.client import CambAI

client = CambAI(api_key=os.environ["CAMB_API_KEY"])

created = client.personalize.create_video(
    video_url="https://example.com/workout-video.mp4",
    prompt="Personalize this workout for a total beginner. Say what each move does, how it should feel, and what they can leave out on the first day.",
)
print(created.task_id)
```

```typescript TypeScript SDK theme={null}
import { CambClient } from "@camb-ai/sdk";

const client = new CambClient({ apiKey: process.env.CAMB_API_KEY });

const created = await client.personalize.createVideo({
    video_url: "https://example.com/workout-video.mp4",
    prompt: "Personalize this workout for a total beginner. Say what each move does, how it should feel, and what they can leave out on the first day.",
});
console.log(created.task_id);
```

```python requests theme={null}
import os
import requests

response = requests.post(
    "https://client.camb.ai/apis/personalize-video",
    headers={"x-api-key": os.environ["CAMB_API_KEY"]},
    json={
        "video_url": "https://example.com/workout-video.mp4",
        "prompt": "Personalize this workout for a total beginner. Say what each move does, how it should feel, and what they can leave out on the first day.",
    },
)
response.raise_for_status()
print(response.json()["task_id"])
```

```bash cURL theme={null}
curl -X POST "https://client.camb.ai/apis/personalize-video" \
  -H "x-api-key: $CAMB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://example.com/workout-video.mp4",
    "prompt": "Personalize this workout for a total beginner. Say what each move does, how it should feel, and what they can leave out on the first day."
  }'
```

## Next Steps

Poll [`/personalize-video/{task_id}`](get-personalize-video-status) until the task reports `SUCCESS`, then fetch the personalized video from [`/personalize-video-result/{run_id}`](get-personalize-video-result).


## OpenAPI

````yaml post /personalize-video
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /personalize-video:
    post:
      tags:
        - Apis
        - Video Personalization
      summary: Create Video Personalization
      description: >-
        Rewrite a video's speech for a specific audience and re-voice it in the
        original speakers' voices. Send the `video_url` and a `prompt`
        describing who the video is for. Returns a `task_id` to poll.
      operationId: create_personalize_video_personalize_video_post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonalizeVideoRequestPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskID'
                description: >-
                  The unique identifier of the personalization task. Poll it
                  with `GET /personalize-video/{task_id}`.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PersonalizeVideoRequestPayload:
      type: object
      title: PersonalizeVideoRequestPayload
      required:
        - prompt
      properties:
        video_url:
          type: string
          title: Video Url
          description: >-
            Publicly accessible URL of the video to personalize. Provide exactly
            one of `video_url` or `file_id`.
          example: https://example.com/workout-video.mp4
        prompt:
          type: string
          minLength: 1
          maxLength: 5000
          title: Prompt
          description: >-
            Who the video is for, what they already know, and how it should
            speak to them. At least 10 characters. For example `Personalize this
            workout for a total beginner. Say what each move does, how it should
            feel, and what they can leave out on the first day.`
          example: >-
            Personalize this workout for a total beginner. Say what each move
            does, how it should feel, and what they can leave out on the first
            day.
        keep_music:
          type: boolean
          title: Keep Music
          default: true
          description: Keep the original background music under the personalized voiceover.
        project_name:
          type:
            - string
            - 'null'
          minLength: 3
          maxLength: 255
          title: Project Name
          default: null
          description: Name shown for the run in Studio. Defaults to a generated name.
        folder_id:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
          title: Folder Id
          default: null
          description: >-
            Folder to file the run under. See
            [Folders](/api-reference/endpoint/create-folder).
        file_id:
          type: string
          format: uuid
          title: File Id
          description: >-
            `file_id` of a video uploaded through the Files API, which is
            enabled per workspace. Provide exactly one of `video_url` or
            `file_id`.
          example: 0f8e2a1c-4b6d-4f1a-9c3e-77b0d2a5e913
    TaskID:
      properties:
        task_id:
          type: string
          title: Task ID
      type: object
      title: Task ID
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````

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