Subtitle converter API: SRT, WebVTT and JSON with scale and shift

Updated 2026-11-19

Use when an agent must convert SRT, WebVTT or JSON subtitles, shift timing or correct growing drift.

POST https://tanod.dev/v1/text/subtitles-convert converts a subtitle file between SRT (SubRip), WebVTT and a JSON segment list [{"start", "end", "text"}] (seconds, the shape /v1/audio/transcribe returns), and can scale timing to correct growing drift or shift every cue by milliseconds. It costs USD 0.002 per call, paid in USDC through x402, with no account and no API key. Free daily allowance applies as for the other text tools. The same function is the convert_subtitles tool in the MCP server at https://tanod.dev/mcp.

Example

curl -s -X POST https://tanod.dev/v1/text/subtitles-convert \
  -H "Content-Type: application/json" \
  -d '{"to": "vtt", "shift_ms": 500, "content": "1\n00:00:01,000 --> 00:00:03,500\nHello there.\n\n2\n00:01:04,000 --> 00:01:06,250\nBye.\n"}'
{
  "operation": "subtitles-convert", "from": "srt", "to": "vtt", "cues": 2, "shift_ms": 500, "dropped": 0, "duration": 66.75,
  "output": "WEBVTT\n\n00:00:01.500 --> 00:00:04.000\nHello there.\n\n00:01:04.500 --> 00:01:06.750\nBye.\n\n",
  "segments": null
}

Fields: to is srt, vtt or json. Give either content (SRT or WebVTT text; the format is detected from the WEBVTT header, or set from_format) or segments (a JSON list). With to: "json" the reply has segments instead of output. time_scale is a finite number from 0.5 to 2.0, default 1; shift_ms runs from -86,400,000 to 86,400,000. Cue bounds and real WebVTT inline timestamp tags follow new_ms = round(old_ms * time_scale) + shift_ms, with ties rounded to even. Starts clamp at 0; with a negative shift, cues ending at or before 0 are dropped (counted in dropped). On timing changes, inline tags outside the new cue or no longer increasing are removed; their text stays.

Correct growing drift with two anchors

For two matching anchor pairs in milliseconds, use scale = (new2-new1)/(old2-old1), with old2 > old1. Then set shift = new1 - round(old1*scale). For example, anchors 1000 to 1500 and 11000 to 11900 give time_scale: 1.04 and shift_ms: 460.

{"to": "json", "segments": [{"start": 1, "end": 11, "text": "Hello."}], "time_scale": 1.04, "shift_ms": 460}

Returned segments:

[{"start": 1.5, "end": 11.9, "text": "Hello."}]

Strict parsing

Malformed input is a 422 that names the cue (for example "cue 3: end is before start"), and it is not charged. That covers a missing or invalid timing line, minutes or seconds of 60 or more, an end before its start, an empty cue, an SRT cue number that is not a number, two cues with no blank line between them, control characters, a missing WEBVTT header, and a JSON segment that is not exactly {start, end, text} with numeric seconds. WebVTT NOTE, STYLE and REGION blocks, cue identifiers and cue settings are accepted and skipped. Other markup inside cue text (<b>) is kept as is.

Limits

Pair it with transcription

Take segments from /v1/audio/transcribe (optionally with translate_to_english), edit the text, and send them here to get SRT or WebVTT, or take the vtt a video tool gave you and get SRT.

Related

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/text?via=subtitle-converter-api as a custom connector (steps), then ask in plain words, for example "Convert this SRT subtitle file to WebVTT and shift every cue 2 seconds later." The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.

Updated 2026-11-19. All guides, or back to tanod.dev.