Skip to main content

Audio Upload API

Upload an audio file and receive a private object_key. Use this identifier with APIs that accept an uploaded file from the same project space.


API information​

  • Endpoint: /v1/files/upload
  • Request method: POST
  • Request format: multipart/form-data
  • Authentication: X-API-Key request header
  • Response format: JSON. Check the HTTP status and succeed; use error_code and error_message for failures.

Request headers​

HeaderTypeRequiredDescription
X-API-KeystringYesProject API key.

Let your HTTP client set the multipart/form-data Content-Type with its boundary. Do not set application/json or omit the multipart boundary.


Form parameters​

Form fieldTypeRequiredDescription
scenestringYesFile type. Use audio for audio files.
filefileYesOne nonempty audio file, no larger than 50 MiB.

scene details​

scenePurposeMaximum file sizeSupported filename extensions
audioAudio file upload50 MiB.wav, .mp3, .m4a, .webm, .ogg

The file must use one of the listed extensions and be no larger than 50 MiB. There is no audio duration limit for uploading. Follow the input requirements of the API where you use the uploaded file.

Files with .flac, .aac, or .opus extensions are not accepted. AAC and Opus are codecs rather than filename extensions; use a permitted container extension that meets the requirements of the API consuming the file.


Rate limit​

  • The default limit is 30 uploads per user per hour, shared across that user's project keys.

Response parameters​

Common response envelope​

FieldTypeDescription
error_codenumberBusiness error code; 0 on success.
error_messagestringError description.
succeedbooleanWhether the upload succeeded.
dataobject | nullUpload result on success; null on failure.

data fields​

FieldTypeDescription
object_keystringPrivate identifier for the uploaded audio file.
file_namestringOriginal filename.
sizenumberFile size in bytes.
scenestringUpload scene, audio.

No public download URL is returned. Use the object key only in its owning project space and the API environment where it was uploaded.

Response example​

Successful requests return HTTP 200:

{
"error_code": 0,
"error_message": "",
"succeed": true,
"data": {
"object_key": "returned-private-object-key",
"file_name": "sample.wav",
"size": 160044,
"scene": "audio"
}
}

Request examples​

Upload audio​

export VUILABS_API_BASE_URL="https://api.vuilabs.ai"
export VUILABS_API_KEY="your-api-key"
curl --request POST \
--url "$VUILABS_API_BASE_URL/v1/files/upload" \
--header "X-API-Key: $VUILABS_API_KEY" \
--form "scene=audio" \
--form "file=@/path/to/sample.wav"

Use the returned data.object_key unchanged when an API requests an uploaded audio file. The object key is a private identifier, not a public download URL.


Common errors​

Failures return a non-2xx HTTP status and the standard JSON error envelope.

HTTP statuserror_codeMeaning
40110003Missing or invalid API key.
40010001Invalid multipart request, missing/empty file, or unsupported scene.
40020012Unsupported audio filename extension.
41320010File exceeds 50 MiB.
42910005Upload limit reached.
50410006Upload timed out.
50320002Storage is temporarily unavailable.
50010000Unexpected service error.

See Errors for other common failures.