Add AI-powered subtitles to videos programmatically. The SubSpark API accepts a video file and returns a subtitled MP4.
The SubSpark API lets you add AI subtitles to videos from your own code. Send a video file, get back a subtitled MP4 — same pipeline as the web app.
⚡ API access requires a Pro or Business plan. View plans →
All API requests must include your API key in the Authorization header using Bearer token format.
Authorization: Bearer sk_live_your_api_key_hereGenerate and manage your API keys in the Dashboard → API section. Keys start with sk_live_.
Security: Never expose your API key in client-side code or public repositories. Treat it like a password.
/api/v1/subtitlesProcesses a video file and returns a new MP4 with subtitles burned in. The subtitles are transcribed automatically using AI and rendered in the style you choose.
fileFilerequiredThe video file to process. Supported formats: MP4, MOV, AVI, MKV. Max size: 500MB.
stylestringSubtitle style name. Default: classic. Options: karaoke, neon, bold, minimal, classic, fire, ice, shadow, retro, cinema, pop, ghost.
positionstringSubtitle position on screen. Default: bottom. Options: top, center, bottom.
font_sizenumberFont size override. Default: 0 (uses style default).
On success, the API returns the processed video as a binary video/mp4 stream.
Content-Typevideo/mp4Always video/mp4Content-Dispositionattachment; filename="subtitled.mp4"Suggested filenameX-Languagee.g. en, es, autoDetected language of the audioError responses are JSON with an error field:
{ "error": "Invalid or revoked API key" }curl -X POST https://subspark.net/api/v1/subtitles \
-H "Authorization: Bearer sk_live_your_api_key" \
-F "file=@my_video.mp4" \
-F "style=bold" \
-F "position=bottom" \
--output subtitled.mp4const fs = require('fs')
const FormData = require('form-data')
const form = new FormData()
form.append('file', fs.createReadStream('video.mp4'))
form.append('style', 'bold')
form.append('position', 'bottom')
const res = await fetch('https://subspark.net/api/v1/subtitles', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_your_api_key',
...form.getHeaders(),
},
body: form,
})
if (!res.ok) {
const err = await res.json()
throw new Error(err.error)
}
const buffer = await res.arrayBuffer()
fs.writeFileSync('subtitled.mp4', Buffer.from(buffer))
console.log('Done! Language:', res.headers.get('X-Language'))import requests
with open('video.mp4', 'rb') as f:
res = requests.post(
'https://subspark.net/api/v1/subtitles',
headers={'Authorization': 'Bearer sk_live_your_api_key'},
files={'file': f},
data={'style': 'bold', 'position': 'bottom'},
)
res.raise_for_status()
with open('subtitled.mp4', 'wb') as out:
out.write(res.content)
print('Language:', res.headers.get('X-Language'))The API is rate-limited per API key. If you exceed the limit, you will receive a 429 Too Many Requests response.
Processing time depends on video length. Large files may take 30–120 seconds. Set an appropriate timeout.
Questions or issues? hello@subspark.net or visit the contact page.