API reference
One session, two streams.
Audio goes in, translated audio and text come out. Everything else is options.
Preview — subject to change before general availability
Quickstart
import { BabelGO } from '@babelgo/sdk'
const session = await BabelGO.connect({
apiKey: process.env.BABELGO_API_KEY,
source: 'auto', // detect the incoming language
target: 'en',
mode: 'half-duplex', // 'full-duplex' in quiet rooms
glossary: 'gls_9f2c', // optional workspace glossary
retention: 'none', // discard audio and transcripts on close
})
session.on('partial', (event) => {
// Fires continuously while the speaker is talking.
console.log(event.transcript, '->', event.translation)
})
session.on('final', (event) => {
console.log(event.translation, `${event.latencyMs} ms`)
})
// Push 20 ms PCM frames as they arrive from the microphone.
microphone.on('frame', (frame) => session.push(frame))Events
- partial
- Emitted continuously as speech arrives. Both `transcript` and `translation` may be revised by a later event with the same `turnId`.
- final
- The turn is committed and will not be revised. Carries the measured end-to-end `latencyMs`.
- audio
- Synthesised translated audio, streamed as Opus frames. Begins before the `final` event.
- error
- Recoverable errors carry `retryable: true`. The session stays open unless `fatal` is set.
Want an API key?
Access opens with general availability. Join the waitlist and mark yourself as a developer — that cohort gets keys first.
Request API access