JoinInDocs
Baton
v2 (beta)
Get a key
Baton v2 Get started BetaMarkdown

Introduction

Know when people have finished talking, whether an interruption is real, and who said what.

Baton listens to a live conversation and sends your voice agent typed events over one WebSocket:

  • End of turn. turn.end fires when a speaker has finished, not merely paused.
  • Barge-in. When someone talks over your agent, bargein.class says whether they are claiming the floor or just saying "mm-hmm". A lone "stop" or one of your answer words counts at once, even over your agent's speech.
  • Your agent's echo. Send what your agent says on agent.speech and Baton ignores your agent's own voice coming back through the user's speaker, so it never interrupts your agent or opens a turn. Audio that is already echo-free? Turn it off with "echo": "off".
  • Expected answers. Send the answers you expect with your question on agent.speech and Baton tells you which one the user gave, with a confidence, so your agent can act on the answer the moment the turn ends. English only.
  • Per-speaker transcripts. For several people mixed on one channel, Baton separates the voices (up to 8) and transcribes each one live.
  • Language per voice. Baton identifies each voice's language and switches its transcription within the languages you allow.
Stream Room
Endpoint /v2/stream /v2/room
Who is speaking One person, typically your agent's caller Several people mixed on one channel
End of turn Yes Yes, for the room as a whole
Barge-in Yes Yes
Echo of your agent ignored (needs text, words or duration_s on agent.speech; "echo": "off" turns it off) Yes Yes
Expected answers (English) Yes Yes
Per-speaker transcripts No Yes
Language per voice No Yes

A room is a stream plus transcripts and languages: the same session options and the same events, with speaker: "room". A room's session.started has no tier field.

How it works

One caller asks a question, pauses mid-sentence, finishes, and later says "mm-hmm" while your agent answers. When the caller goes quiet, Baton decides whether they have finished. If it is confident, turn.end follows at the operating point's delay (300 ms for cutoff_5pct); if not, the turn ends only when the silence reaches the timeout. At the mid-sentence pause it is not confident, so there is no turn.end. When the caller speaks over your agent, Baton tells a real interruption from a backchannel:

How Baton decides: end of turn and barge-in on one exchange A caller asks a question with a short pause mid-sentence. Baton judges each silence 200 ms in. At the pause its end-of-turn confidence is low, so no turn.end; after the caller stops it is confident, and turn.end fires 300 ms after the end of speech. While the agent answers, the caller says mm-hmm; Baton's barge-in confidence stays low and bargein.class reports a backchannel, so the agent keeps talking. Caller Agent Baton's confidence Baton sends You send 300 ms What's the weather in Saint Paul? mm-hmm pause It's 57 °F and clear in Saint Paul… pause: still low, so no turn.end judged 200 ms in: confident low: a backchannel vad.start vad.start turn.end bargein.onset vad.end vad.end respond now bargein.class: backchannel keep talking agent.speech start agent.speech end 0 s12 345 67 s Caller speech Agent speech End-of-turn confidence Barge-in confidence Wait from end of speech to turn.end (300 ms at cutoff_5pct) Messages you send Audio time. Confidence curves are illustrative.

The same exchange as it arrives on the socket, for a session that asked for "signals": ["vad", "bargein"]:

// the caller starts speaking
{"type": "vad.start", "seq": 1, "t": 0.3, "speaker": "user"}
// a pause mid-sentence: not confident the turn is over
{"type": "vad.end", "seq": 2, "t": 1.5, "speaker": "user",
 "duration": 1.2}
{"type": "vad.start", "seq": 3, "t": 1.8, "speaker": "user"}
{"type": "vad.end", "seq": 4, "t": 2.7, "speaker": "user",
 "duration": 0.9}
// 300 ms later Baton is confident: respond now
{"type": "turn.end", "seq": 5, "t": 3.0, "speaker": "user",
 "p_eot": 0.81, "latency_ms": 300, "by": "score",
 "profile": "cutoff_5pct"}
// at 3.7 s you send agent.speech, phase start, utterance sp_1
// the caller speaks over your agent
{"type": "vad.start", "seq": 6, "t": 5.0, "speaker": "user"}
{"type": "bargein.onset", "seq": 7, "t": 5.0,
 "agent_speaking": true, "utterance_id": "sp_1"}
// it was a backchannel: keep talking
{"type": "bargein.class", "seq": 8, "t": 5.3,
 "class": "backchannel", "p_claim": 0.12,
 "decided_after_ms": 300, "utterance_id": "sp_1"}
{"type": "vad.end", "seq": 9, "t": 5.4, "speaker": "user",
 "duration": 0.4}
// at 6.6 s you send agent.speech, phase end, utterance sp_1

t is seconds of audio you have sent, and seq numbers the events from 1 with no gaps. session.started carries "schema_version": 2, once for the connection. In a room, these events carry "speaker": "room", and per-speaker transcripts arrive alongside them.

Choosing what you receive

By default a session gets only what most agents act on: session.started, turn.end, turn.resumed, turn.answer, turn.hint, warning and session.summary, plus asr.final and asr.flushed in a room. Add names to signals in session.start for more:

Name You also get Where
vad vad.start, vad.end: each stretch of speech stream, room
bargein bargein.onset, bargein.class: someone talking over your agent stream, room
partials asr.partial: words while they may still change room
language asr.language and the language.* events room

What you ask for changes only what you are sent, never when turns end. session.started echoes the list in effect, and an unknown name closes the session with 1008 (eot, from before turn events always arrived, is accepted and ignored). Every event, what it means and what to do with it: Events.

Baton is in private beta. Request a key at hello@joinin.ai. The v2 API can still change; ignore fields and events you don't recognise.

Pick an endpoint

Endpoint For You get Latency at 5 % false cut-offs (English)
/v2/stream One speaker: a voice agent and its caller. Can use the conversation context you send at the start. VAD, end of turn, barge-in, expected answers 563 ms
/v2/room Several people mixed on one channel, or one caller when you also want transcripts (see the limits). Everything a stream gives, plus per-speaker transcripts and language ID 563 ms

Latency is the mean delay from the end of speech to turn.end on Baton's benchmark, at the cutoff_5pct operating point. Every endpoint takes the same session options; see End of turn for the faster and more careful points, and for patient, which waits through long thinking pauses.

Servers

Environment Host Notes
Production baton.joinin.ai Every endpoint, including /v2/stream and /v2/room.
Test baton-test.joinin.ai Changes reach this server first. For integration testing; may be briefly unavailable.
Last updated 21 Oct 2026