{"openapi":"3.1.0","info":{"title":"Middleware API","version":"1.0.0","description":"Every API published through the gateway, behind one host and one access token. Send the token as `Authorization: Bearer <token>` or `X-API-Key: <token>`."},"servers":[{"url":"https://api.audiclabs.com"}],"tags":[{"name":"noise-suppressor","description":"AudicLabs noise suppression. Removes background noise from speech with the Audic models: standalone (one file at a time or in bulk) or streaming (real time over a WebSocket)."},{"name":"diarization","description":"AudicLabs speaker diarization: who spoke when in calls, meetings and podcasts, up to 8 speakers, recordings of any length."},{"name":"stt","description":"AudicLabs speech to text: accurate transcripts in 40 languages, with automatic language detection."},{"name":"tts","description":"AudicLabs text to speech: natural voices in English, Arabic and Indian English, with hundreds of input languages."}],"paths":{"/v1/noise-suppressor/denoise":{"post":{"tags":["noise-suppressor"],"summary":"Remove noise","description":"Clean one audio or video file. Send it as multipart/form-data in the file field (WAV, FLAC, MP3, M4A, AAC, OGG, Opus, WebM, MP4 and more, any sample rate, up to 100 MB). Returns the cleaned audio as WAV named audiclabs.ns.<your file name>.wav, at the sample rate you uploaded, with processing stats in the X-NS-Stats header.","operationId":"noise-suppressor_denoise","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":1.0,"x-required-scope":"noise-suppressor:denoise","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The audio or video to clean."},"model":{"type":"string","description":"Optional. Audic 1 is the fastest, Audic 4 the best 16 kHz quality and Audic 5 keeps full-band 48 kHz audio. Leave it out to use Audic 2.","enum":["audic-1","audic-2","audic-3","audic-4","audic-5"]}},"required":["file"]}}}}}},"/v1/noise-suppressor/denoise/batch":{"post":{"tags":["noise-suppressor"],"summary":"Remove noise (bulk)","description":"Clean up to 25 files in one call. Repeat the files field once per file. Returns audiclabs.ns.batch.zip with every cleaned file (audiclabs.ns.<file name>.wav) plus manifest.json (per-file status, output name, stats or error). A file that fails is listed in the manifest and does not stop the batch. The X-NS-Batch header summarises files, succeeded, failed and processing time.","operationId":"noise-suppressor_denoise-batch","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":1.0,"x-required-scope":"noise-suppressor:denoise-batch","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"The audio or video files to clean, up to 25. Repeat the field for each file."},"model":{"type":"string","description":"Optional. Audic 1 is the fastest, Audic 4 the best 16 kHz quality and Audic 5 keeps full-band 48 kHz audio. Leave it out to use Audic 2.","enum":["audic-1","audic-2","audic-3","audic-4","audic-5"]}},"required":["files"]}}}}}},"/v1/noise-suppressor/health":{"get":{"tags":["noise-suppressor"],"summary":"Health","description":"Service status, version and installed models. Free; use it for monitoring.","operationId":"noise-suppressor_health","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"noise-suppressor:health"}},"/v1/noise-suppressor/models":{"get":{"tags":["noise-suppressor"],"summary":"List models","description":"Every Audic model (Audic 1 to Audic 8) with its sample rate, description and whether it is installed. Use an installed id as the optional model field of /denoise, /denoise/batch and /stream.","operationId":"noise-suppressor_models","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"noise-suppressor:models"}},"/v1/noise-suppressor/sample":{"get":{"tags":["noise-suppressor"],"summary":"Sample clip","description":"Download a short noisy 16 kHz speech clip (WAV) to try the API with.","operationId":"noise-suppressor_sample","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"noise-suppressor:sample"}},"/v1/noise-suppressor/stream":{"get":{"tags":["noise-suppressor"],"summary":"Remove noise (streaming)","description":"WebSocket (wss://api.audiclabs.com/v1/noise-suppressor/stream). Authenticate with a header, or from a browser with ?ticket= from POST /v1/tickets. Real-time noise suppression over a WebSocket. Send mono little-endian PCM as binary frames (float32 by default, int16 with format=s16; 10 to 100 ms per frame works well) at the sample_rate you declare, and receive cleaned PCM in the same encoding at the model's rate. The first message is JSON {type: ready, output_sample_rate, ...}. Text commands: flush (returns the tail, then {type: flushed}), reset, stats. Servers authenticate with the Authorization header; browsers connect with ?ticket= from POST /v1/tickets. One credit per session, sessions up to 60 minutes, frames up to 1 MB.","operationId":"noise-suppressor_stream","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"101":{"description":"Switching protocols; the session starts"}},"x-credit-cost":1.0,"x-required-scope":"noise-suppressor:stream","parameters":[{"name":"sample_rate","in":"query","required":false,"schema":{"type":"string"},"example":16000},{"name":"format","in":"query","required":false,"schema":{"type":"string"},"example":"f32"},{"name":"model","in":"query","required":false,"schema":{"type":"string"}},{"name":"ticket","in":"query","required":false,"schema":{"type":"string"},"description":"Single-use ticket from POST /v1/tickets, for browsers."}],"x-websocket":true}},"/v1/diarization/diarize":{"post":{"tags":["diarization"],"summary":"Diarize audio","description":"Find who spoke when. Send the recording as multipart/form-data in the file field (WAV, MP3, M4A/AAC, FLAC, OGG/Opus, WebM or the audio track of common video files, up to 200 MB and 4 hours). Returns each speaker's segments with start and end times in seconds; speakers are numbered speaker_1, speaker_2, ... in order of first appearance, up to 8.","operationId":"diarization_diarize","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":1.0,"x-required-scope":"diarization:diarize","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The recording to diarize."},"merge_gap":{"type":"number","example":0.5,"description":"Optional. Join a speaker's segments separated by a pause up to this many seconds (0 to 5). Default 0: segments exactly as detected."},"threshold":{"type":"number","example":0.5,"description":"Optional. Speech detection sensitivity, 0.05 to 0.95. Lower finds more quiet speech, higher only confident speech. Default 0.5."},"response_format":{"type":"string","example":"json","description":"Optional. json (default) or rttm.","enum":["json","rttm"]}},"required":["file"]}}}}}},"/v1/diarization/health":{"get":{"tags":["diarization"],"summary":"Health","description":"Service readiness, queue depth and throughput. Free; use it for monitoring.","operationId":"diarization_health","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"diarization:health"}},"/v1/diarization/models":{"get":{"tags":["diarization"],"summary":"List models","description":"The diarization model you are calling, with its speaker limit and sample rate.","operationId":"diarization_models","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"diarization:models"}},"/v1/stt/health":{"get":{"tags":["stt"],"summary":"Health","description":"Service readiness. Free; use it for monitoring.","operationId":"stt_health","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"stt:health"}},"/v1/stt/languages":{"get":{"tags":["stt"],"summary":"List languages","description":"Every language code with its support tier (ready, broad, adaptation); auto detects it.","operationId":"stt_languages","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"stt:languages"}},"/v1/stt/models":{"get":{"tags":["stt"],"summary":"List models","description":"The speech-to-text models you can use in the model field.","operationId":"stt_models","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"stt:models"}},"/v1/stt/stream":{"get":{"tags":["stt"],"summary":"Transcribe live (streaming)","description":"WebSocket (wss://api.audiclabs.com/v1/stt/stream). Authenticate with a header, or from a browser with ?ticket= from POST /v1/tickets. Real-time transcription over a WebSocket. Send a JSON start message {type: start, language?, sample_rate?, chunk_ms?, words?}, wait for {type: ready}, then send 16-bit little-endian mono PCM as binary frames (up to 2 s each) at the sample_rate you declared. Receive {type: partial} with the text so far and its delta as you speak; send {type: stop} to get {type: final} with the whole transcript (and word timings when words is true). Servers authenticate with the Authorization header; browsers connect with ?ticket= from POST /v1/tickets. One credit per session; sessions close after 30 s without audio.","operationId":"stt_stream","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"101":{"description":"Switching protocols; the session starts"}},"x-credit-cost":1.0,"x-required-scope":"stt:stream","x-websocket":true,"parameters":[{"name":"ticket","in":"query","required":false,"schema":{"type":"string"},"description":"Single-use ticket from POST /v1/tickets, for browsers."}]}},"/v1/stt/transcriptions":{"post":{"tags":["stt"],"summary":"Transcribe audio","description":"Turn speech into text. Send the recording as multipart/form-data in the file field (WAV, MP3, M4A/AAC, FLAC, OGG/Opus, WebM, AMR or the audio track of common video files). Returns JSON with the transcript in text.","operationId":"stt_transcriptions","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":1.0,"x-required-scope":"stt:transcriptions","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The audio or video to transcribe."},"model":{"type":"string","example":"audic-stt-1","description":"Optional. The speech model; audic-stt-1.","enum":["audic-stt-1"]},"language":{"type":"string","example":"en-US","description":"Optional. Language code from GET /languages, or auto (default) to detect it."},"response_format":{"type":"string","example":"json","description":"Optional. Default json."},"prompt":{"type":"string","description":"Optional. Words or names to steer spelling, e.g. AudicLabs."}},"required":["file"]}}}}}},"/v1/tts/health":{"get":{"tags":["tts"],"summary":"Health","description":"Service readiness. Free; use it for monitoring.","operationId":"tts_health","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"tts:health"}},"/v1/tts/languages":{"get":{"tags":["tts"],"summary":"List languages","description":"Every language code the speech model accepts.","operationId":"tts_languages","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"tts:languages"}},"/v1/tts/speech":{"post":{"tags":["tts"],"summary":"Generate speech","description":"Turn text into natural speech. Send JSON with the model, the text in input and a voice id from GET /voices. Returns the audio file (MP3 unless you ask for another response_format).","operationId":"tts_speech","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":1.0,"x-required-scope":"tts:speech","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","example":"audic-tts-1","description":"The speech model. Use audic-tts-1.","enum":["audic-tts-1"]},"input":{"type":"string","example":"Hello from AudicLabs.","description":"The text to speak."},"voice":{"type":"string","example":"voice_bilal_en","description":"Voice id from GET /voices (the catalogue grows as voices are onboarded)."},"response_format":{"type":"string","description":"Optional. Audio format of the result. Default mp3."},"speed":{"type":"number","example":1.0,"description":"Optional. Speaking rate; 1.0 is normal."},"language":{"type":"string","example":"en","description":"Optional. Language code from GET /languages. Defaults to the voice's language."},"stream":{"type":"boolean","example":true,"description":"Optional. Default true: MP3 bytes are sent as they are generated, so playback can start after the first second. false waits and returns the whole file at once."}},"required":["model","input","voice"]}}}}}},"/v1/tts/stream":{"get":{"tags":["tts"],"summary":"Generate speech (streaming)","description":"WebSocket (wss://api.audiclabs.com/v1/tts/stream). Authenticate with a header, or from a browser with ?ticket= from POST /v1/tickets. Real-time speech over a WebSocket, one utterance per connection. Send one JSON message {model, input, voice, speed?, language?}; receive {type: start} with the audio format, then binary frames that are consecutive pieces of one MP3 stream, then {type: done} with audio_seconds and first_audio_ms. Send {type: cancel} to stop early. Servers authenticate with the Authorization header; browsers connect with ?ticket= from POST /v1/tickets. One credit per session.","operationId":"tts_stream","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"101":{"description":"Switching protocols; the session starts"}},"x-credit-cost":1.0,"x-required-scope":"tts:stream","x-websocket":true,"parameters":[{"name":"ticket","in":"query","required":false,"schema":{"type":"string"},"description":"Single-use ticket from POST /v1/tickets, for browsers."}]}},"/v1/tts/voices":{"get":{"tags":["tts"],"summary":"List voices","description":"Every voice you can use, with its id, name, language and dialect.","operationId":"tts_voices","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Upstream response"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the required scope"},"429":{"description":"Rate limit exceeded"}},"x-credit-cost":0.0,"x-required-scope":"tts:voices"}},"/v1/tickets":{"post":{"tags":["tickets"],"summary":"Stream ticket","description":"Exchange your token for a single-use ticket, valid for 60 seconds, that opens one WebSocket session from a browser without exposing the token.","operationId":"tickets_create","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["service","endpoint"],"properties":{"service":{"type":"string","example":"noise-suppressor"},"endpoint":{"type":"string","example":"stream"}}}}}},"responses":{"200":{"description":"`{ticket, expires_in, service, endpoint, url}`"},"401":{"description":"Missing or invalid access token"},"403":{"description":"Token lacks the endpoint's scope"}},"x-credit-cost":0}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"security":[{"bearerAuth":[]}]}