# Omnivoice

> Omnivoice API endpoint


## Overview

- **Endpoint**: `https://fal.run/fal-ai/omnivoice`
- **Model ID**: `fal-ai/omnivoice`
- **Category**: unknown
- **Kind**: inference


## Pricing

- **Price**: $0 per compute seconds

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:


- **`prompt`** (`string`, _required_):
  The text to synthesize into speech.
  - Examples: "The future belongs to those who believe in the beauty of their dreams."

- **`audio_url`** (`string`, _required_):
  URL of the reference audio file for voice cloning. The model will clone the voice style from this audio.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav"

- **`ref_text`** (`string`, _optional_):
  Transcript of the reference audio. If not provided, an ASR model will automatically transcribe it.

- **`language`** (`string`, _optional_):
  Language name (e.g. 'English', 'Chinese') or ISO 639-1 code (e.g. 'en', 'zh'). The model supports 600+ languages. If not provided, the model uses language-agnostic mode. Specifying the language may improve quality for the target language.
  - Examples: "English"

- **`num_inference_steps`** (`integer`, _optional_):
  Number of iterative decoding steps for the diffusion process. Default value: `32`
  - Default: `32`
  - Range: `1` to `32`

- **`guidance_scale`** (`float`, _optional_):
  Classifier-free guidance scale. Default value: `2`
  - Default: `2`
  - Range: `0` to `10`

- **`speed`** (`float`, _optional_):
  Speaking speed factor. Greater than 1.0 for faster, less than 1.0 for slower. Default value: `1`
  - Default: `1`
  - Range: `0.5` to `2`

- **`duration`** (`float`, _optional_):
  Fixed output duration in seconds. If not provided, the model estimates duration from the text. Overrides speed when both are provided.
  - Range: `0.1` to `50`

- **`enable_safety_checker`** (`boolean`, _optional_):
  Authorized callers may set false to request relaxed screening. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "prompt": "The future belongs to those who believe in the beauty of their dreams.",
  "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav"
}
```

**Full Example**:

```json
{
  "prompt": "The future belongs to those who believe in the beauty of their dreams.",
  "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav",
  "language": "English",
  "num_inference_steps": 32,
  "guidance_scale": 2,
  "speed": 1,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  The generated speech audio file.



**Example Response**:

```json
{
  "audio": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/omnivoice \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "The future belongs to those who believe in the beauty of their dreams.",
     "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav"
   }'
```

### 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/omnivoice",
    arguments={
        "prompt": "The future belongs to those who believe in the beauty of their dreams.",
        "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav"
    },
    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/omnivoice", {
  input: {
    prompt: "The future belongs to those who believe in the beauty of their dreams.",
    audio_url: "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav"
  },
  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/omnivoice)
- [API Documentation](https://fal.ai/models/fal-ai/omnivoice/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/omnivoice)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
