# ElevenLabs Dubbing

> Generate dubbed videos or audios using ElevenLabs Dubbing feature!


## Overview

- **Endpoint**: `https://fal.run/fal-ai/elevenlabs/dubbing`
- **Model ID**: `fal-ai/elevenlabs/dubbing`
- **Category**: audio-to-video
- **Kind**: inference
**Tags**: dubbing, audio-to-audio



## Pricing

Your request will cost **$0.9** per minute. The calculation will be based on the **closest minute after rounding upwards**.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`audio_url`** (`string`, _optional_):
  URL of the audio file to dub. Either audio_url or video_url must be provided.

- **`video_url`** (`string`, _optional_):
  URL of the video file to dub. Either audio_url or video_url must be provided. If both are provided, video_url takes priority.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/elevenlabs/e11_dubbing_in.mp4"

- **`target_lang`** (`string`, _required_):
  Target language code for dubbing (ISO 639-1)
  - Examples: "es", "fr", "de", "ja", "pt", "zh"

- **`source_lang`** (`string`, _optional_):
  Source language code. If not provided, will be auto-detected.
  - Examples: "en", "es", "fr"

- **`num_speakers`** (`integer`, _optional_):
  Number of speakers in the audio. If not provided, will be auto-detected.
  - Range: `1` to `50`

- **`highest_resolution`** (`boolean`, _optional_):
  Whether to use the highest resolution for dubbing. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "target_lang": "es"
}
```

**Full Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/example_inputs/elevenlabs/e11_dubbing_in.mp4",
  "target_lang": "es",
  "source_lang": "en",
  "highest_resolution": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  The dubbed video file. Will be populated if video_url was provided in the request.
  - Examples: {"file_size":1344041,"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/e11_dubbing_out.mp4","file_name":"e11_dubbing_out.mp4"}

- **`target_lang`** (`string`, _required_):
  The target language of the dubbed content
  - Examples: "es"



**Example Response**:

```json
{
  "video": {
    "file_size": 1344041,
    "content_type": "video/mp4",
    "url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/e11_dubbing_out.mp4",
    "file_name": "e11_dubbing_out.mp4"
  },
  "target_lang": "es"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/elevenlabs/dubbing \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "target_lang": "es"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/elevenlabs/dubbing",
    arguments={
        "target_lang": "es"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/elevenlabs/dubbing", {
  input: {
    target_lang: "es"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/elevenlabs/dubbing)
- [API Documentation](https://fal.ai/models/fal-ai/elevenlabs/dubbing/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/elevenlabs/dubbing)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
