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

# Dub audio

> Translate an audio file with an asynchronous Dubbing job.

Dubbing translates speech into a target language and preserves the source speakers' voices. The API accepts MP3, WAV, or M4A audio up to 6 hours and 4 GB per file. Use the Web Dubbing workspace to upload video.

An active paid subscription and sufficient credits are required. Each target language costs 2,000 credits per minute of source audio, prorated and rounded up to a whole credit. A 30-second clip costs 1,000 credits. Your plan's Dubbing and shared generation concurrency limits apply.

1. Create a signed upload with the filename, content type, and exact byte size. Upload the file with `PUT` using the returned headers and matching `Content-Length`. Send the BreezeBlue API key only to the API, and keep the signed URL private.
2. Submit the returned `source_asset_id` and a target language code. The API returns HTTP 202 with a `dubbing_id`. Omit the source language to detect it automatically. To repeat a timed-out submission, use the same source asset ID, language parameters, and idempotency key.
3. Poll the job every few seconds. When its status is `ready`, download the MP3, WAV, SRT, or WebVTT file using the URLs in `output`. If it returns `failed`, check `error`. Invalid, overlength, and video files can fail asynchronously when the job inspects the uploaded bytes.

```python Python theme={null}
from uuid import uuid4

from breeze_blue import BreezeBlue

with BreezeBlue() as client:
    source_id = client.dubbing.upload("talk.mp3")
    job = client.dubbing.create(
        source_asset_id=source_id,
        target_language="es",
        idempotency_key=str(uuid4()),
    )
    current = client.dubbing.get(job["dubbing_id"])
    print(current)
```

```typescript TypeScript theme={null}
import { openAsBlob } from "node:fs";
import { BreezeBlueClient } from "@breeze.blue/sdk";

const client = new BreezeBlueClient();
const audio = await openAsBlob("talk.mp3");
const sourceAssetId = await client.dubbing.upload(audio, "talk.mp3");
const job = await client.dubbing.create({
  sourceAssetId,
  targetLanguage: "es",
  idempotencyKey: crypto.randomUUID(),
});
console.log(await client.dubbing.get(job.dubbingId));
```

```bash CLI theme={null}
source_id=$(breeze dubbing upload --file talk.mp3 --output json | jq -r .source_asset_id)
job_id=$(breeze dubbing create --source-asset-id "$source_id" \
  --target-language es --idempotency-key talk-es-01 --output json | jq -r .dubbing_id)
breeze dubbing get "$job_id" --output json
```


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