Skip to content

Upload file

POST
/v1/files/upload

Upload a file that can be used across various endpoints.

Authorizations

BearerAuth
TypeHTTP (bearer)

Request Body

Content Type: multipart/form-data

Submit the request as multipart/form-data, not JSON. Provide either the file field with binary file content or the url field with a file URL.

Schema

file  string

The File object (not file name) to be uploaded. Size limit: 10 MB. Mutually exclusive with the url parameter.

Format binary

url  string

The URL of the file to uploaded. Mutually exclusive with the file parameter.

purpose  stringrequired

The intended purpose of the uploaded file.

For the following purposes:

  • reference: Supported format (mp3, m4a). The supported audio duration range is [30,30] seconds, excess will be trimmed.
  • melody: Supported format (mp3, m4a, mid). Utilizes vocal extracted from uploaded audio, uploading a MIDI file is recommended. The supported audio duration range is [5,60] seconds, excess will be trimmed.
  • instrumental: Supported format (mp3, m4a). The supported audio duration range is [30,30] seconds, excess will be trimmed.
  • voice: Supported format (mp3, m4a). The supported audio duration range is [5,15] seconds, excess will be trimmed.
  • audio: Supported format (mp3, m4a). A common audio file, used for song extension and similar purposes.
  • remix: Supported format (mp3, m4a). Used for remixing. The supported audio duration range is [10,350] seconds.
  • soundtrack: Supports videos and images. Use the url field for large files. Supported video format (.mp4, .mov, .avi, .mkv, .webm), size limit: 100 MB. Supported image format (.jpg, .jpeg, .png, .webp), size limit: 50 MB.
  • lyrics-video: Supported format (.jpg, .jpeg, .png, .webp, .gif). A common image file, used for lyrics video background images.

Valid valuesreferencemelodyinstrumentalvoiceaudioremixsoundtracklyrics-video

Responses

The uploaded File object.
application/json

Samples