Short answer: use fetch with FormData for the audio file, let the browser create the multipart boundary, and hide provider-specific behavior behind a server-side REST API adapter.
A portable transcription integration should make the upload protocol boring and the provider decision reversible. For an edtech code-review service, that means accepting one audio file at an application boundary, preserving a small job record, and translating provider-specific responses behind an adapter. The browser should never need to know which speech engine is active.
The useful answer is a fetch request with FormData , a server-owned endpoint, and a contract that treats transcription as an asynchronous job when files or queues make that necessary. Do not set the multipart Content-Type header yourself. The browser adds the boundary; a hand-written header commonly leaves the server unable to parse the body.
What should the upload boundary promise?
A student may attach a short spoken explanation of a code change.…