/v1/realtime sessions — what makes it a duet is the wiring
between them.
When to use it
Hear the agent before a customer does. Reading a transcript tells you what an agent said. Listening to it handle a difficult caller tells you whether it should have. Point your agent at a counterpart briefed to interrupt, change its mind, or refuse to confirm anything, and listen to the whole call. Test the parts that only break live. Barge-in, end-of-turn detection, and recovery after an interruption are timing behaviours. They do not show up in a single-turn test, and they are exactly what a second live speaker exercises. Load-test with real sessions. Every duet is two concurrent realtime sessions doing real work, which is a more honest capacity test than replaying recorded audio.How it works
Open two sessions and forward each one’s output audio into the other’s input. Give each side its own instructions and its own voice, so you can tell them apart in the recording.1
Open both sessions
Two
/v1/realtime connections, each configured with its own voice and
instructions. Browser clients can use POST /v1/realtime/ticket rather than
carrying an API key.2
Cross-pipe the audio
Forward audio frames from session A to session B’s input, and B’s to A’s.
Nothing else is special: both sides believe they are talking to a person.
3
Give one side the first word
Send an initial turn to whichever agent should open, or the two will sit
waiting for each other.
A duet is two concurrent realtime sessions, and it counts as two against your
plan’s concurrency limit. If sessions refuse to start, that limit is the first
thing to check.
Try it without writing anything
The platform has this built in at Studio → Duet: pick two voices, give each a brief, and listen. It is the fastest way to hear whether a persona holds up against a difficult counterpart before you wire it into a test suite.Going further
Realtime
The session protocol both sides speak.
Sessions
Transcripts and recordings from each side, linked by
paired_session_id.