================================================================================ POST /api/upload/ Uploads a file to the server. Parameters (http headers): Content-Disposition: attachment; filename= -- a name of the file (see rfc6266). Authorization: license -- a user license, optional (if there is no license it is necessary to use csrf tokens) Returns (json): { "status": "success" | "error" "id": uploaded file id if the status is "success" "size" (int): the media file size in bytes if the status is "success" "duration" (float): the media file duration in seconds if the status is "success" "error": Error description if the status is "error" } Examples: $ curl --url https://www.lalal.ai/api/upload/ --data-binary @any_file.mp3 --header "Content-Disposition: attachment; filename=any_file.mp3" --header "Authorization: license 14abcde0" {"status": "success", "id": "9a3ae258-7693-4046-87c2-ef577eb752bb", "duration": 435.05} $ curl --url https://www.lalal.ai/api/upload/ --data-binary @any_file.mp3 {"status": "error", "error": "No file name (use the Content-Disposition header)"} Notes: Upload limit is 2Gb if a request has a valid license in the Authorization header otherwise 1Gb ================================================================================ POST /api/preview/ Puts a file in the preview queue (the first minute of vocals). Parameters (http headers): Authorization: license -- a user license, optional (if there is no license it is necessary to use csrf tokens) Parameters (form-urlencoded): id (str): File id obtained from /upload/ method. filter_type (int, optional): Number of postprocess iterations with MWF. webpush-callback (json, optional): Client data for sending push notifications. Returns (json): { "status": "success" | "error" "error": Error description if the status is "error" } Examples: $ curl --url https://www.lalal.ai/api/preview/ --form-string "id=9a3ae258-7693-4046-87c2-ef577eb752bb" --form-string "filter_type=2" {"status": "success"} $ curl --url https://www.lalal.ai/api/preview/ {"status": "error", "error": "No file id"} ================================================================================ POST /api/split/ Puts a file in the split queue (full media file splitting). Parameters (http headers): Authorization: license -- a user license, required Parameters (form-urlencoded): id (str): File id obtained from /upload/ method. filter_type (int, optional): Number of postprocess iterations with MWF. webpush-callback (json, optional): Client data for sending push notifications. Returns (json): { "status": "success" | "error" "error": Error description if the status is "error" } Examples: $ curl --url https://www.lalal.ai/api/split/ --form-string "id=9a3ae258-7693-4046-87c2-ef577eb752bb" --form-string "lisence=397ae4" {"status": "success"} $ curl --url https://www.lalal.ai/api/split/ --form-string "id=9a3ae258-7693-4046-87c2-ef577eb752bb" {"status": "error", "error": "No lisence"} ================================================================================ POST /api/cancel/ Cancels the current task and sets the status to canceled for the task, if it exists and is running. Parameters (http headers): Authorization: license -- a user license, optional (if there is no license it is necessary to use csrf tokens) Parameters (form-urlencoded): id (str): File id obtained from /upload/ method. Returns (json): { "status": "success" | "error" "error": Error description if the status is "error" } Examples: $ curl --url https://www.lalal.ai/api/cancel/ --form-string "id=9a3ae258-7693-4046-87c2-ef577eb752bb" {"status": "success"} $ curl --url https://www.lalal.ai/api/cancel/ --form-string "id=9a3ae258-7693-4046-87c2" {"status": "error", "error": "Task not found"} ================================================================================ GET /api/check/ Gets the file info, results of preview or split, a current task status, etc. Parameters (query string): id (str): File id obtained from /upload/ method. Returns (json): { "status": "success" | "error" "name": the file name if the status is "success" "size": the file size in bytes if the status is "success" "duration": the file duration in seconds if the status is "success" "preview" (nullable): { "vocals": a url of preview vocals, "vocals_size" (int): vocals file size in bytes, "accompaniment": a url of preview accompaniment, "accompaniment_size" (int): accompaniment file size in bytes }: if the status is "success" and the preview task has successfully completed "split" (nullable): { "vocals": a url of vocals, "vocals_size" (int): vocals file size in bytes, "accompaniment": a url of accompaniment, "accompaniment_size" (int): accompaniment file size in bytes } if the status is "success" and the split task has successfully completed "task" (nullable): { "name": "split" | "preview", "state": "success" | "error" | "progress" | "cancelled", "error" (nullable): Error description if the state is "error" or "cancelled", "progress" (int, nullable): a task progress (0..100) if the state is "progress", } if the status is "success" and some task has been invoked "error": Error description if the status is "error" } Examples: $ curl --url https://www.lalal.ai/api/check/?id=9a3ae258-7693-4046-87c2-ef577eb752bb {"status": "success"} $ curl --url https://www.lalal.ai/api/check/?id=9a3ae258 {"status": "error", "error": "Invalid file id"} ================================================================================ GET /billing/get-limits/ Current limits of a user license. Parameters (http headers): Authorization: license -- a user license Returns (json): { "status": "success" | "error", "error": Error description if the status is "error", "uses_left" (int): processed tracks count, "duration_left" (int): total processed tracks duration in minutes, } Examples: $ curl --url https://www.lalal.ai/billing/get-limits/ --header "Authorization: license d5394d17" {"status": "success", "uses_left": 19, "duration_left": 89} $ curl --url https://www.lalal.ai/billing/get-limits/ --header "Authorization: license d539" {"status": "error", "error": "License not found"} ================================================================================ GET /billing/get-licence/ Current user license info. Parameters (http headers): Authorization: license -- a user license Returns (json): { "status": "success" | "error", "error": Error description if the status is "error", "key": license key, "option": license type, "email": user email, "process_count_used" (int): processed tracks count, "process_count_limit" (int): tracks count limit, "process_duration_used" (int): total processed tracks duration in minutes, "process_duration_limit" (int): total tracks duration limit, } Examples: $ curl --url https://www.lalal.ai/billing/get-licence/ --header "Authorization: license d5394d17" {"status": "success", "key": "d5394d17", "option": "standard", "creation_time": "2020-08-26T12:11:15.028Z" ... $ curl --url https://www.lalal.ai/billing/get-licence/ --header "Authorization: license d539" {"status": "error", "error": "License not found"}