---
title: "Cut an audio file between specified timestamps"
method: POST
path: "/v1/audio_cutter"
---

# Cut an audio file between specified timestamps

`POST /v1/audio_cutter`

## Request

- Base URL: `https://api.musicgpt.com/api/public`
- URL: `https://api.musicgpt.com/api/public/v1/audio_cutter`
- Auth: API key in header `Authorization`

Trims an audio file using the specified start and end times.

## Request body `multipart/form-data`

- union
  - object
    - `audio_url` string, required: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary: Audio file to upload and process directly.
    - `start_time` number, float, required: Start time in milliseconds.
    - `end_time` number, float, required: End time in milliseconds.
    - `output_extension` 'mp3' | 'wav' | 'flac' | 'ogg' | 'aac' | 'webm': Desired output format.
    - `webhook_url` string: Callback URL for async processing results.
  - object
    - `audio_url` string: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary, required: Audio file to upload and process directly.
    - `start_time` number, float, required: Start time in milliseconds.
    - `end_time` number, float, required: End time in milliseconds.
    - `output_extension` 'mp3' | 'wav' | 'flac' | 'ogg' | 'aac' | 'webm': Desired output format.
    - `webhook_url` string: Callback URL for async processing results.

## Response `200`

Successfully initiated audio cut

- object
  - `success` boolean
  - `conversion_id` string
  - `credit_estimate` number, float
  - `conversion_path` string
  - `message` string

## Other responses

- `400`: Invalid parameters
- `401`: Invalid authentication
- `402`: Insufficient credits
- `404`: User or plan not found
- `500`: Internal server error

---

[API](https://skmtc.dev/musicgpt/apis/musicgpt-api.md) - [All operations](https://skmtc.dev/musicgpt/apis/musicgpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/musicgpt/apis/musicgpt-api/revisions/6753dccf4c5d?raw)
