# DeepFilterNet 3

> Enhance speech audio by removing background noise and upsampling to 48KHz


## Overview

- **Endpoint**: `https://fal.run/fal-ai/deepfilternet3`
- **Model ID**: `fal-ai/deepfilternet3`
- **Category**: audio-to-audio
- **Kind**: inference
**Tags**: speech-enhancement



## Pricing

- **Price**: $0.001 per 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:


- **`audio_url`** (`string`, _required_):
  The URL of the audio to enhance.
  - Examples: "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3"

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`

- **`audio_format`** (`AudioFormatEnum`, _optional_):
  The format for the output audio. Default value: `"mp3"`
  - Default: `"mp3"`
  - Options: `"mp3"`, `"aac"`, `"m4a"`, `"ogg"`, `"opus"`, `"flac"`, `"wav"`

- **`bitrate`** (`string`, _optional_):
  The bitrate of the output audio. Default value: `"192k"`
  - Default: `"192k"`



**Required Parameters Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3"
}
```

**Full Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3",
  "audio_format": "mp3",
  "bitrate": "192k"
}
```


### Output Schema

The API returns the following output format:

- **`audio_file`** (`AudioFile`, _required_):
  The audio file that was enhanced.
  - Examples: {"sample_rate":48000,"content_type":"audio/mpeg","duration":6.9544375,"channels":1,"file_name":"-2cD9CyGEjYsyVQ5lEERh_9qwIkJjf.mp3","bitrate":"192k","url":"https://v3b.fal.media/files/b/0a8a4024/-2cD9CyGEjYsyVQ5lEERh_9qwIkJjf.mp3"}

- **`timings`** (`DeepFilterNetTimings`, _required_):
  Timings for each step in the pipeline.



**Example Response**:

```json
{
  "audio_file": {
    "sample_rate": 48000,
    "content_type": "audio/mpeg",
    "duration": 6.9544375,
    "channels": 1,
    "file_name": "-2cD9CyGEjYsyVQ5lEERh_9qwIkJjf.mp3",
    "bitrate": "192k",
    "url": "https://v3b.fal.media/files/b/0a8a4024/-2cD9CyGEjYsyVQ5lEERh_9qwIkJjf.mp3"
  },
  "timings": {}
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/deepfilternet3 \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3"
   }'
```

### 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/deepfilternet3",
    arguments={
        "audio_url": "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3"
    },
    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/deepfilternet3", {
  input: {
    audio_url: "https://v3b.fal.media/files/b/0a8a4022/DLoZhabKeVjd3urncoRE4_dirty.mp3"
  },
  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/deepfilternet3)
- [API Documentation](https://fal.ai/models/fal-ai/deepfilternet3/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/deepfilternet3)

### 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)
