---
title: "Edit Audio"
method: POST
path: "/audio/edit"
tags: ["Audio"]
---

# Edit Audio

`POST /audio/edit`

## Request

- Base URL: `https://video-api.picsart.io/v1`
- URL: `https://video-api.picsart.io/v1/audio/edit`
- Auth: API key in header `X-Picsart-API-Key`

Comprehensive audio editing with one operation — the audio counterpart of Edit Video. Trim the audio, apply fades, adjust loudness, and change the format, bitrate and sample rate of the input audio.
Send the audio source together with an `export` object describing the output you want. For example, `{"audio_url": "https://example.com/input.wav", "export": {"format": "mp3", "bitrate": 192, "sample_rate": 44100}}` produces a 192 kb/s, 44.1 kHz MP3. Leave `bitrate` empty to let the service pick an optimal value, and omit `sample_rate` unless you need a specific one.
Trim with `start` / `end` (both in milliseconds), and shape the edges with `fade_in` / `fade_out` or `trim_silence`. Set loudness with either `volume` (a dB offset) or `normalize` (a -16 LUFS broadcast target). Two pairs are mutually exclusive: `trim_silence` cannot be combined with `fade_out`, and `normalize` cannot be combined with `volume`.

## Request body

- object
  - `audio_url` string, uri: Source audio URL.
  - `start` integer: The point in time of the audio from where the trimming (in milliseconds) begins.
  - `end` integer: The point in time of the audio where the trimming (in milliseconds) ends. It must be greater than `start`. Leave empty to trim to the end of the audio.
  - `fade_in` integer: Fade-in duration in milliseconds, applied from the beginning of the output.
  - `fade_out` integer: Fade-out duration in milliseconds, applied to the end of the output. Cannot be combined with `trim_silence`.
  - `trim_silence` boolean: Remove silence from the beginning and the end of the audio. Cannot be combined with `fade_out`.
  - `volume` number: Volume adjustment in dB. Negative values make the audio quieter, positive values louder. Cannot be combined with `normalize`.
  - `normalize` boolean: Normalize loudness to a broadcast target of -16 LUFS. Cannot be combined with `volume`.
  - `export` object: Export options for the output audio.
    - `format` 'mp3' | 'wav' | 'm4a' | 'flac' | 'ogg': Optionally select one of the output audio formats (mp3 is chosen if left blank). Options are as follows * mp3 * wav * m4a * flac * ogg
    - `bitrate` integer: Output bitrate in kb/s. Leave empty to optimize automatically.
    - `sample_rate` integer: Output sample rate in Hz.

## Response `202`

Request successfully accepted for an asynchronous transformation.

- object
  - `transaction_id` string, nullable
  - `status` 'success' | 'error' | 'processing' | 'queued'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `413`: Request Entity Too Large
- `415`: Unsupported Media Type
- `429`: Too Many Requests
- `431`: Request Header Fields Too Large
- `500`: Internal Server Error
- `503`: Service Unavailable
- `529`: Overloaded. The model provider is overloaded and could not complete this request. Please retry shortly, or switch to a different model.

---

[API](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis.md) - [All operations](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/picsart/apis/picsart-programmable-video-apis/revisions/e3f1d0bea43b?raw)
