How to Get SRT or VTT Subtitles From Audio With an API

To get subtitles from audio with an API, send the recording to a speech-to-text endpoint and ask for the subtitle format directly: with DeProcess, POST to /v1/audio/transcriptions with response_format set to srt or vtt, or fetch any finished job with GET /v1/jobs/{id}?format=srt or ?format=vtt. SRT is the plain numbered format almost every video editor accepts; VTT (WebVTT) is the W3C format web browsers load through the HTML track element.
Key takeaways
- DeProcess returns SRT or VTT from response_format on the request, or from ?format=srt or ?format=vtt on any finished transcription job, as often as you like.
- SRT timestamps use a comma before the milliseconds (00:00:03,100); WebVTT uses a period (00:00:03.100) and the file starts with WEBVTT.
- WebVTT is a W3C specification; SRT has no formal specification, according to the Library of Congress format description.
- Use VTT for captions in a web video player and SRT for video editors and most upload forms.
- A speech transcript gives you dialogue-only subtitles; captions for viewers who can't hear the audio also describe sounds and need a human pass.
How do you get SRT or VTT subtitles from an audio file with an API?
Ask the speech-to-text API for the subtitle format instead of plain text. OpenAI's API reference lists srt and vtt among the values of the transcription response_format parameter, and APIs that follow OpenAI's format, such as DeProcess, use the same parameter. The model produces timestamped segments either way; the format setting only changes how they are written out.
With DeProcess there are two ways to do it, described in the speech-to-text API docs:
- On the request. POST the file to
/v1/audio/transcriptionswithresponse_format=srtorresponse_format=vtt. Good for short clips where you wait for the answer. - After the job is done. Fetch any finished transcription with
GET /v1/jobs/{id}?format=srtor?format=vtt. Good for long recordings sent as async jobs, and for getting several formats from one job.
If you are new to how recordings move through a queue, the guide to how batch speech to text works covers the whole flow.
What does the request look like?
For a short file (up to about 4 MB), upload it and ask for SRT. With curl:
curl https://api.deprocess.ai/v1/audio/transcriptions -H "Authorization: Bearer dpc_your_key" -F file=@voicemail.mp3 -F response_format=srt
With the official OpenAI Python SDK pointed at DeProcess (see switching an OpenAI-compatible API by changing the base URL):
client = OpenAI(base_url="https://api.deprocess.ai/v1", api_key="dpc_your_key")srt = client.audio.transcriptions.create(model="whisper", file=open("voicemail.mp3", "rb"), response_format="srt")
For subtitle formats the SDK hands back the file as a string, ready to save as voicemail.srt. We checked this with openai 3.39.0 for Python and 7.45.1 for JavaScript on November 10, 2026, against a local test server that answers in the DePro formats.
For a long recording, send a link as an async job, then fetch subtitles when it is done:
curl "https://api.deprocess.ai/v1/jobs/a1b2c3d4e5f6?format=srt" -H "Authorization: Bearer dpc_your_key"
The webhook tips in the docs suggest exactly this: when the webhook arrives, fetch the job with ?format=srt or vtt. The same finished job can be fetched in every format (srt, vtt, text, json or verbose_json) as often as you like, so you can keep SRT for your editors and VTT for your website without paying twice. Speech to text costs $0.12 per audio hour, billed by the minute, according to the DePro pricing table.
What is inside an SRT file?
An SRT file is plain text made of numbered blocks. The Library of Congress format description lists four parts per block:
- a number giving the position of the subtitle,
- a start and end time separated by
-->, in the form hours:minutes:seconds,milliseconds (00:00:00,000), - the subtitle text, on one or more lines,
- a blank line that ends the block.
A short example:
100:00:00,000 --> 00:00:03,100Thanks for calling.
SRT came from SubRip, a program for pulling subtitles off DVDs. The Library of Congress calls it a very simple text format that is "not well standardized" and notes there is little to no formal documentation. In practice that means each tool accepts slightly different variations, and the safe choice is the plain form above. The same description mentions a common limit of 32 characters per line; check what your video platform expects.
What is inside a WebVTT file?
WebVTT (Web Video Text Tracks) is the subtitle format for the web, published by the W3C. As of November 10, 2026, the W3C page is a Candidate Recommendation Draft dated 20 May 2026. The specification's acknowledgements say the SRT format was used as the basis for WebVTT, which is why the two look so alike.
The main rules from the specification:
- The file starts with the string
WEBVTT(optionally after a byte order mark), followed by blank lines. - Timestamps use a period before the thousandths of a second:
00:00:03.100. The hours part is optional unless it is non-zero, so00:03.100is also valid. - A file is UTF-8 text with the media type
text/vtt. - Cues may carry settings after the time range, such as
align:right size:50%in the specification's own example, and can be styled with CSS.
SRT or VTT: which should you use?
Use VTT for the web and SRT for everything else. Both describe the same timed cues, so the choice is about where the file goes.
| SRT | WebVTT (VTT) | |
|---|---|---|
| Who defines it | No formal specification (de facto format from SubRip) | W3C specification |
| First line | Cue number 1 | WEBVTT |
| Time format | 00:00:03,100 (comma) | 00:00:03.100 (period); hours optional |
| Cue numbers | Required | Optional identifiers |
| Positioning and styling | Very limited | Cue settings and CSS |
| Best for | Video editors, upload forms on video platforms | HTML5 video players on your own site |
On a web page, MDN explains that a WebVTT file is attached to a video with the HTML track element, and the HTML standard defines that element as the way to add "explicit external timed text tracks" to media. A browser won't load an SRT file there, so convert it to VTT or ask the API for VTT directly. See the glossary for short definitions of SRT and VTT.
Are transcripts subtitles or captions?
An automatic transcript gives you subtitles, and only a first draft of captions. The HTML standard draws the line clearly in its definition of the track element's kind attribute:
- Subtitles are a transcription or translation of the dialogue, for viewers who can hear the sound but don't understand it.
- Captions also cover sound effects, relevant musical cues and other audio information, for viewers who can't hear the sound.
A speech-to-text model writes down what people say. It doesn't add "[door slams]" or "[music fades]". If your subtitles are for accessibility, plan a human review that adds those sounds and checks names and numbers. Use kind="subtitles" or kind="captions" on the track element to say which you are providing.
How do you check subtitle quality before publishing?
Spot-check a few minutes of each file against the video:
- Timing. The first and last cues should line up with speech. If the video was trimmed after transcription, transcribe the final cut instead.
- Line length. Long segments make long cues. If your platform has limits, rebuild cues from the timestamped segments in
verbose_json, which DeProcess returns with a start, end and text for each segment. - Names and numbers. These are where transcription errors hurt most. The guide to word error rate explains how to measure accuracy on your own audio.
- Encoding. Save as UTF-8 so accented letters display correctly; WebVTT requires it.
When is another tool a better fit?
If you need captions on a live broadcast or a video call while people are speaking, you need a live (streaming) captioning service; DeProcess is built for recorded audio processed in batches. If you need professionally reviewed captions to meet a legal or broadcast standard, a human captioning service is the better choice, or at least a human review of the API's draft. For archives of recorded video, lectures, podcasts and training material, getting SRT and VTT from an API is the fast and cheap way to start.
Frequently asked questions
Can I get both SRT and VTT from one transcription?
Yes. With DeProcess, the same finished job can be fetched in srt, vtt, text, json or verbose_json, as often as you like, so you pay for the transcription once.
How do I convert SRT to VTT myself?
Add a WEBVTT line and a blank line at the top, and change the comma before the milliseconds in each timestamp to a period. Cue numbers can stay; WebVTT allows an identifier line before each cue.
Why do my subtitles drift out of sync?
The usual causes are an edited or trimmed video after transcription, or a different start offset in the video file. Transcribe the final cut of the audio, and check the first and last cues against the video.
Are automatic subtitles good enough for accessibility?
They are a strong first draft. Captions meant for people who can't hear the audio should be reviewed by a person and should include relevant sounds, as the HTML standard's definition of captions describes.
Sources
- W3C: WebVTT, The Web Video Text Tracks Format (Candidate Recommendation Draft, 20 May 2026)
- Library of Congress: SubRip Subtitle format (SRT), format description fdd000569
- WHATWG: HTML Living Standard, the track element
- MDN Web Docs: Web Video Text Tracks Format (WebVTT)
- OpenAI: API reference, audio (transcription response_format)
- DeProcess: API docs (speech to text, transcript formats)
Have recordings to transcribe?
Test DeProcess on your own audio. Ask for a free 10-hour test, or start with the free credit every new account gets. Same API format as OpenAI.
Start a free testHave a computer that sits idle?
Install the DePro app and your computer works on AI jobs while you’re away. Free to join, about five minutes to set up.
Join with your computerRelated guides
- Speech to textHow Batch Speech to Text Works, Step by StepBatch speech to text queues recordings, cuts them into pieces, transcribes them in parallel and returns text and subtitles later. Here is how each step works.
- Speech to textHow to Transcribe Long Audio Files (Hours Long) With an APITo transcribe hours-long audio, send a link instead of uploading, ask for an async job and collect the transcript by webhook or by polling the job id.
- Speech to textHow Webhooks Work for Asynchronous Transcription JobsA transcription webhook is a POST the API sends to your https address when a job finishes. Here is what DeProcess sends and how to build the receiver.
About this guide
Last reviewed . Written by Sydney Kibuuka, Founder, researched and drafted with AI and checked by automated quality checks before it was published. Facts about other companies come from their own published pages, with dates. Read our editorial standards; spotted a mistake? Tell us and we’ll fix it (see corrections).