Upload File

Use this API to upload necessary files to the Unisound Maas Platform.
POST/v1/files/upload

Authorization

AuthorizationstringheaderRequired
HTTP: Bearer Auth

Request Header

Content-TypestringDefault: multipart/form-dataRequired

Request Body

purpose string Required

The purpose of the file. Values and supported formats are as follows:

  • voice_clone: Original file for fast clone (supports wav format)
  • prompt_audio: Sample audio for voice clone (supports wav format)
  • t2a_async_input: Text file in the request body for async long-text TTS (supports text format)
  • a2t_async_input: Audio file in the request body for async speech transcription (supports mp3, opus, wav, amr, m4a, ogg format)
  • ocr_async_input: Image or file in the request body for async document parsing (supports jpg, png, pdf format)

file binary Required

The file to upload. Fill in the file path.

Response Body Structure

fileobject

file.file_idlong

The unique identifier of the file

file.bytesinteger

File size in bytes

file.created_atinteger

Unix timestamp when the file was created, in seconds

file.filenamestring

Name of the file

file.purposestring

Purpose of the file

base_respobject

base_resp.status_codeinteger

Status codes are as follows:
  • 100001, Request parameter error
  • 101999, Internal server error
For more details, see Error Codes.

base_resp.status_msgstring

Status details