For developers
Live captions for your platform, through one API
Agenda, streaming and meeting-management platforms can add live captions and translation. Create a meeting, point the encoder at its stream key, and read the captions as JSON or Server-Sent Events.
Access
Three credentials, each with one job
- Server only
API key
Your platform's key (
sk_…), sent asAuthorization: Bearer. It creates, pauses and closes your meetings. Keep it on your server; never put it in a browser. - Encoder
Stream key
One per meeting. The encoder publishes the meeting's audio and video with it, over RTMPS or SRT (both encrypted) or plain RTMP.
- Safe for browsers
View token
One per meeting. Screens and phones use it to read that meeting's captions, and nothing else.
Each platform only ever sees its own meetings. Keys are stored only as hashes.
Meetings
Create a meeting, then stream to it
POST /v1/meetingsCreate a meeting: title, translation languages, optional glossary, your own ID and a YouTube caption URL.POST /v1/meetings/{id}/pausePause captioning for recess or closed session. Nothing is captioned, stored or billed while paused.POST /v1/meetings/{id}/resumeResume captioning, within a few seconds.GET /v1/meetingsYour latest meetings, newest first, with state and usage.DELETE /v1/meetings/{id}Close a meeting. The stream key stops working; captions stay readable.
POST https://api.sentracaptions.com/v1/meetings
Authorization: Bearer sk_XXXX
{ "title": "City Council Regular Meeting",
"languages": ["es", "zh", "vi"],
"externalId": "agenda-2291" }
# 201 Created
{ "id": "m_XXXX",
"state": "created",
"ingest": {
"rtmps": { "server": "rtmps://ingest.sentracaptions.com:1936",
"streamKey": "m_XXXX?key=XXXX" },
"rtmp": { … },
"srt": "srt://ingest.sentracaptions.com:8890?streamid=…" },
"viewToken": "XXXX",
"links": { "captions", "stream", "transcript", "display", "phone" } }
Meeting states: created · live · paused · ended · closed.
The encoder can disconnect and reconnect; it is the same meeting.
Reading captions
Instant updates, or poll
GET …/rooms/{id}/streamServer-Sent Events: each finished caption, the sentence in progress, and status changes.GET …/rooms/{id}/captionsFinished captions as JSON, the latest few or everything after a cursor.GET …/rooms/{id}/transcriptThe whole meeting so far in one language, as TXT or SRT.
const events = new EventSource(meeting.links.stream);
events.addEventListener('caption', (e) => {
const c = JSON.parse(e.data);
show(c.text.en, c.text.es); // one entry per language
});
Ready-made pages
Embed the chamber screen and phone page
Every meeting comes with a full-screen chamber display and a phone page, built only on this API. Open the
display link on the chamber TV or put it in an iframe, and put the phone link behind
your own QR code or button.
JavaScript library
Captions in your page, no iframe
One script tag puts an accessible caption box with a language picker in your page, styled to match your site. Or use the events and draw the captions yourself.
- Ready-made box: language picker, live status, screen-reader friendly, right-to-left languages
- Restyle with CSS variables, or use events only and render your own way
- Reconnects on its own and falls back to polling on difficult networks
- Uses the meeting's view token only; API keys stay on your server
<div id="captions"></div>
<script src="https://api.sentracaptions.com/sdk/v1/captions.js"></script>
<script>
SentraCaptions.mount('#captions', {
meeting: 'm_XXXX',
token: 'VIEW_TOKEN',
lang: 'es'
});
</script>
Building an integration? Ask us for API access and we'll send the full reference.
Webhooks
Know when a meeting ends
When a meeting's stream ends, SentraCaptions sends meeting.ended to your webhook URL,
with your own meeting ID, links to the transcripts in every language, and the minutes used.
{ "event": "meeting.ended",
"meetingId": "m_XXXX",
"externalId": "agenda-2291",
"usage": { "audioMinutes": 142.5, "captions": 1630 },
"transcripts": { "en": { "txt": "…", "srt": "…" },
"es": { "txt": "…", "srt": "…" } } }