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

# Denoise

> Remove background noise and isolate voice from audio files. Upload an audio file and receive a cleaned audio file with enhanced voice clarity.

## Authentication

Requires API key authentication via `x-api-key` header.

## Request

**Content-Type:** `multipart/form-data`

### Form Data

| Field   | Type | Required | Description                                                 |
| ------- | ---- | -------- | ----------------------------------------------------------- |
| `audio` | File | Yes      | Audio file to denoise (max 200 MB, max 15 minutes duration) |

### File Limits

* **Maximum file size:** 200 MB
* **Maximum duration:** 15 minutes

Supported audio formats: WAV, MP3, M4A, FLAC, OGG

## Response

**Status Code:** `200 OK`

**Headers:**

* `Content-Type: audio/wav`
* `Cache-Control: no-cache`
* `Content-Length: <file_size>`

**Body:** Denoised audio file (WAV format)

### Error Responses

**400 Bad Request**

```json theme={null}
{
  "errorCode": "400xx",
  "errorMessage": "File size exceeds 200 MB limit"
}
```

```json theme={null}
{
  "errorCode": "400xx",
  "errorMessage": "Audio duration exceeds 15 minutes limit"
}
```

**401 Unauthorized**

```json theme={null}
{
  "errorCode": "40101",
  "errorMessage": "Invalid or missing API key"
}
```

**402 Payment Required**

```json theme={null}
{
  "errorCode": "40201",
  "errorMessage": "Insufficient wallet balance"
}
```

## Example Usage

### JavaScript

```javascript theme={null}
const formData = new FormData();
const audioFile = document.querySelector('input[type="file"]').files[0];
formData.append("audio", audioFile);

const response = await fetch('https://api.faseeh.ai/api/v1/denoise', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    // Note: Content-Type is set automatically by FormData
  },
  body: formData,
});

if (response.ok) {
  const audioBlob = await response.blob();
  const audioUrl = URL.createObjectURL(audioBlob);
  // Use audioUrl to play or download the denoised audio
} else {
  const error = await response.json();
  console.error('Error:', error);
}
```

### Python

```python theme={null}
import requests

url = "https://api.faseeh.ai/api/v1/denoise"
headers = {
    "x-api-key": "YOUR_API_KEY"
}

with open("input_audio.wav", "rb") as audio_file:
    files = {"audio": audio_file}
    response = requests.post(url, files=files, headers=headers)

if response.status_code == 200:
    with open("denoised_audio.wav", "wb") as f:
        f.write(response.content)
    print("Denoised audio saved successfully")
else:
    print(f"Error: {response.status_code} - {response.text}")
```

### cURL

```bash theme={null}
curl -X POST "https://api.faseeh.ai/api/v1/denoise" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "audio=@input_audio.wav" \
  --output denoised_audio.wav
```

<Note>
  **File Limits**: Ensure your audio file is under 200 MB and 15 minutes duration. Larger files will be rejected with a 400 error.
</Note>


## OpenAPI

````yaml POST /denoise
openapi: 3.1.0
info:
  title: Faseeh API
  description: >-
    Faseeh - First True Arabic Voice AI that speaks Dialects From Abu Dhabi to
    Rabat with Voice Cloning & On-prem support
  version: 1.0.0
servers:
  - url: https://api.faseeh.ai/api/v1
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /denoise:
    post:
      tags:
        - Voice Isolation
      summary: Denoise Audio
      description: >-
        Remove background noise and isolate voice from audio files. Upload an
        audio file and receive a cleaned audio file with enhanced voice clarity.
      operationId: denoiseAudio
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - audio
              properties:
                audio:
                  type: string
                  format: binary
                  description: Audio file to denoise (max 200 MB, max 15 minutes duration)
      responses:
        '200':
          description: Denoised audio file
          content:
            audio/wav:
              schema:
                type: string
                format: binary
                description: WAV audio file with enhanced voice clarity
        '400':
          description: >-
            Bad Request - File size exceeds 200 MB or duration exceeds 15
            minutes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Payment Required - Insufficient wallet balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - errorCode
        - errorMessage
      properties:
        errorCode:
          type: string
          description: Error code identifier
        errorMessage:
          type: string
          description: Human-readable error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````