---
title: "Master an audio file using a reference track"
method: POST
path: "/v1/audio_mastering"
---

# Master an audio file using a reference track

`POST /v1/audio_mastering`

## Request

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

Processes an input audio file to match the mastering characteristics of a reference track.

## Request body `multipart/form-data`

- union
  - object
    - `audio_url` string, required: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary: Input audio file to upload directly.
    - `reference_audio_url` string, required: URL of the reference audio file to match.
    - `reference_audio_file` string, binary: Reference audio file to upload directly.
    - `output_extension` 'mp3' | 'wav' | 'flac' | 'ogg' | 'aac' | 'webm': Desired output file format.
    - `webhook_url` string: Callback URL to receive async result.
  - object
    - `audio_url` string: Input audio URL (supported format: YouTube URL).
    - `audio_file` string, binary, required: Input audio file to upload directly.
    - `reference_audio_url` string: URL of the reference audio file to match.
    - `reference_audio_file` string, binary, required: Reference audio file to upload directly.
    - `output_extension` 'mp3' | 'wav' | 'flac' | 'ogg' | 'aac' | 'webm': Desired output file format.
    - `webhook_url` string: Callback URL to receive async result.

## Response `200`

Successfully queued for mastering

- object
  - `success` boolean
  - `task_id` string
  - `conversion_id` string
  - `credit_estimate` number, float
  - `eta` integer
  - `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)
