POST
/
audio_cutter
import requests

url = "https://api.example.com/api/public/v1/audio_cutter"
headers = {
    "Authorization": "<API_KEY>",
    "Content-Type": "multipart/form-data"
}

payload = {
    "audio_path": "https://example.com/input_audio.mp3",
    "start_time": 10500,
    "end_time": 45000,
    "output_extension": "mp3"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
{
  "success": true,
  "conversion_id": "conv789",
  "credit_estimate": 25,
  "conversion_path": "https://example.com/trimmed_audio.mp3",
  "message": "Audio trim task queued successfully"
}

Trim your audio files with precision using AI.

Audio Cutter allows you to select specific sections of audio recordings, making it perfect for creating highlights, clips, ringtones, and more.

  • โœ‚๏ธ Easily extract the best parts of any audio
  • ๐ŸŽถ Supports multiple formats like MP3, WAV, FLAC, and more
  • โšก Fast processing with high-quality output

Audio Cutter ensures your trimmed audio sounds clean and professional.


๐Ÿ“ก Endpoint

POST /audio_cutter

Use this endpoint to trim a section from an existing audio file.


โ–ถ๏ธ Sample Output

Listen to the trimmed audio:

Download Audio

๐Ÿงช Try it Yourself

Visit the Audio Cutter Endpoint Explorer to cut and download trimmed audio segments instantly.

โœ‚๏ธ Try trimming different parts to see how accurate the cut is!


๐Ÿ› ๏ธ Request Parameters

ParameterTypeRequiredDescription
audio_pathStringYesThe S3 path of the input audio file to trim
conversion_idStringYesA unique identifier for the conversion request
start_timeFloatYesThe start time (in milliseconds) of the audio to trim
end_timeFloatYesThe end time (in milliseconds) of the audio to trim
output_extensionStringYesOutput format: mp3, wav, flac, ogg, aac, or webm

๐Ÿ“ฅ Sample Request

๐Ÿ Python

import requests

url = "https://api.musicgpt.com/api/public/v1/audio_cutter"
headers = {
    "Authorization": "<api_key>",
    "Content-Type": "application/json"
}
payload = {
    "audio_path": "https://musicgpt.s3.us-east-1.amazonaws.com/conversions/sample-audio.mp3",
    "start_time": 10.5,
    "end_time": 45.0,
    "output_extension": "mp3"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

๐Ÿ“ค Sample Response

โœ… Success (200 OK)

{
  "success":true,
  "task_id":"b0ac9d46-64d7-4843-af48-a0b6effe3666",
  "conversion_id":"fe19945b-d466-4183-b559-5d264bddd492",
  "eta":66,
  "credit_estimate":25.0,
  "message":"Message published to queue",
  "status":"IN_QUEUE"
}

๐Ÿ“ž Webhook Response

When audio cutter conversion completes, your webhook will receive:

{
  "success": true, 
  "conversion_type": "Audio Cutter", 
  "task_id": "8993b364-9141-4de7-ab38-5a4178618f0e", 
  "conversion_id": "3f07f1ba-9eb5-4581-95ed-427eac1dda0c", 
  "output_file": "https://lalals.s3.amazonaws.com/FileConversions/8993b364-9141-4de7-ab38-5a4178618f0e.mp3", 
  "message": "Audio cutter completed"
} 

๐Ÿ“‚ The conversion_path field contains the direct link to download the trimmed audio.


Authorizations

Authorization
string
header
required

Body

multipart/form-data

Response

200
application/json

Successfully initiated audio cut

The response is of type object.