Skip to main content

Endpoints

POST /upload

https://api.audo.ai/v1/upload

Upload an audio file for future processing.

  • Form data: file=@path/to/file.wav
  • Optional url params:
    • ?inputExt=wav: Overrides input extension

Response:

{
"fileId": "string"
}
Examples

Simple example:

curl -X POST "https://api.audo.ai/v1/upload" -F "file=@myaudio.wav" -H "x-api-key: $AUDO_API_KEY"
{"fileId":"bb7888d6-94ce-4638-aa90-68891257757f"}

Now we can use this fileId in a request to /remove-noise. See below for how.

POST /remove-noise

https://api.audo.ai/v1/remove-noise

Submit an input to the API for noise removal.

  • JSON body:
{
"input": "<fileId>" | "<inputUrl>", // File ID from /upload or URL to download from
"outputExtension": "<extension>", // [Optional] Output file extension (ie. 'mp3')
"output": "<outputUrl>", // [Optional] Url to perform a PUT request with the output
"noiseReductionAmount": "<int>" // [Optional] Amount of noise reduction. 100 = full reduction (default), 1 = almost no noise reduction
}

Response:

{
"jobId": "string"
}
Examples

Using fileId from /upload:

FILE_ID=1b985607-045f-46b4-b8b0-c037592dd10e
curl -X POST "https://api.audo.ai/v1/remove-noise" -d '{"input": "'$FILE_ID'"}' -H "x-api-key: $AUDO_API_KEY"
{"jobId": "45d08ed2-84e6-4f1e-a6f3-2ddbf3c7d8a3"}

Reduce noise by 90% using fileId from /upload:

FILE_ID=1b985607-045f-46b4-b8b0-c037592dd10e
curl -X POST "https://api.audo.ai/v1/remove-noise" -d '{"input": "'$FILE_ID'", "noiseReductionAmount": "90"}' -H "x-api-key: $AUDO_API_KEY"

Remove noise from a remote video:

url=https://dl5.webmfiles.org/big-buck-bunny_trailer.webm
curl -X POST "$BACKEND_URL/remove-noise" -d '{"input": "'$url'", "outputExtension": "mp4"}' -H "x-api-key: $AUDO_API_KEY" -H "x-api-key: $AUDO_API_KEY"

Remove noise from audio within S3 using presigned URLs (read more here):

input=https://bucket.s3.amazonaws.com/foo.webm?AWSAccessKeyId=ABC&Signature=PxM%3D&Expires=1615338399
# Note: See the full example for details about generating this
# It needs to be a PUT request with the appropriate content type
output=https://bucket.s3.amazonaws.com/audo-enhanced_foo.mp4?AWSAccessKeyId=ABC&Signature=e8O%3D&content-type=video%2Fmp4&Expires=1615340231
curl -X POST "https://api.audo.ai/v1/remove-noise" -d '{"input": "'$input'", "output": "'$output'"}' -H "x-api-key: $AUDO_API_KEY"

GET /remove-noise/<jobId>/status

https://api.audo.ai/v1/remove-noise/<jobId>/status

Retrieve the status of a job. Response possibilities:

{ "state": "downloading" } // Only if input is from a URL
{ "state": "queued", "jobsAhead": <number> }
{ "state": "in_progress", "percent": <number> }
{ "state": "succeeded", "downloadPath": "<downloadPath>" }
{ "state": "failed", "reason": "<reason>" }
Examples

Here is an example:

JOB_ID=be1e2138-433d-4278-8a79-698dfbab9168
curl -X GET "https://api.audo.ai/v1/remove-noise/$JOB_ID/status" -H "x-api-key: $AUDO_API_KEY"
{
"state": "succeeded",
"downloadPath": "dl/artifacts/clean/audo_enhanced_d29940ad-feb8-4187-8b31-e5778ef9ad1c.mp3"
}

So, now we would be able to download our file by prepending https://api.audo.ai/v1/:

curl -O https://api.audo.ai/v1/dl/artifacts/clean/audo_enhanced_d29940ad-feb8-4187-8b31-e5778ef9ad1c.mp3

WEBSOCKET /wss/remove-noise/<jobId>/status

wss://api.audo.ai/v1/wss/remove-noise/<jobId>/status

Retrieve the status of a job in realtime without polling. This is a completely optional alternative method to find the status of a job.

  • Message format: Each message is a json encoded object in the exact same representation as the endpoint above:
{ "state": "downloading" } // Only if input is from a URL
{ "state": "queued", "jobsAhead": <number> }
{ "state": "in_progress", "percent": <number> }
{ "state": "succeeded", "downloadPath": "<downloadPath>" }
{ "state": "failed", "reason": "<reason>" }
  • Finally, don't forget to include the authentication header when connecting via x-api-key: $AUDO_API_KEY.
Examples

Here is an example that uses websocat:

JOB_ID=be1e2138-433d-4278-8a79-698dfbab9168
websocat "wss://api.audo.ai/v1/wss/remove-noise/$JOB_ID/status" -H "x-api-key: $AUDO_API_KEY"
{"state": "queued", "jobsAhead": 0}
{"state": "in_progress", "percent": 10}
{"state": "in_progress", "percent": 18}
{"state": "in_progress", "percent": 20}
// ...
{"state": "in_progress", "percent": 95}
{"state": "in_progress", "percent": 98}
{"state": "in_progress", "percent": 100}
{"state": "succeeded", "downloadPath": "dl/artifacts/clean/audo_enhanced_7c9e10b3-96ca-4904-aecf-ce815339c859.wav"}

So, same as before, we can now download our file by prepending https://api.audo.ai/v1/:

curl -O https://api.audo.ai/v1/dl/artifacts/clean/audo_enhanced_7c9e10b3-96ca-4904-aecf-ce815339c859.wav