Skip to content

docs(s2s): Speech-to-Speech API reference page#760

Merged
LeeVaughn merged 11 commits intomainfrom
dan/s2s-docs
Mar 13, 2026
Merged

docs(s2s): Speech-to-Speech API reference page#760
LeeVaughn merged 11 commits intomainfrom
dan/s2s-docs

Conversation

@dan-ince-aai
Copy link
Contributor

Summary

  • Rewrites speechtospeech.mdx (was an old placeholder for a different product) with full documentation for the native S2S WebSocket API
  • Page is marked hidden: true so it's not in the nav until ready to publish

What's covered

  • Quickstart (Python + JavaScript) — connect, configure, stream audio, receive audio
  • Audio format spec (PCM16, 24kHz, mono)
  • Full client→server event reference: audio.append, session.configure, response.create, response.cancel, function.result
  • Full server→client event reference: session.ready, speech.started/stopped, transcript.user.*, response.started/audio/transcript/done/interrupted, function.call, error
  • Session configuration and system prompt guidance
  • Function calling: tool schema, handle function.call, send function.result
  • Interruption / barge-in handling
  • Browser integration with server-side proxy pattern
  • Framework integrations (Pipecat + LiveKit) with code examples
  • Complete end-to-end customer support agent example (Python + JS)
  • Event flow diagram

Notes

  • session.configure is sent immediately on WebSocket connect (not on session.ready) — corrected throughout all examples and the event flow diagram
  • Uses current production event names

🤖 Generated with Claude Code

dan-ince-aai and others added 2 commits March 13, 2026 12:30
Complete rewrite of the Speech-to-Speech docs page (hidden):
- Quickstart with Python + JavaScript WebSocket examples
- Full client→server and server→client event reference with schemas
- Audio format spec (PCM16, 24kHz, mono)
- Session configuration and system prompt guidance
- Function calling: tool schema, handle function.call, send function.result
- Interruption / barge-in handling
- Browser integration with proxy pattern
- Framework integrations (Pipecat + LiveKit) with code examples
- Complete end-to-end customer support agent example
- Event flow diagram

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
….ready

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

… error codes

New from realtime_model.py review:
- greeting field in session.configure
- session.resume client event (reconnection with session_id)
- session_id field in session.ready response
- session.updated server event
- error codes: session_not_found, session_forbidden

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

…ction

The mabudu/renamed-events changes are deployed. Updated all event names:
- audio.append → input.audio
- session.configure → session.update
- speech.started → input.speech.started
- speech.stopped → input.speech.stopped
- response.audio → reply.audio
- response.transcript → transcript.agent
- response.done → reply.done
- function.call → tool.call (arguments is JSON string, not args dict)
- function.result → tool.result

Also:
- Tool schema uses nested {"type":"function","function":{...}} format
- Quickstart replaced with confirmed-working script
- Added warning: audio must be gated behind session_ready
- reply.done has optional status:"interrupted" field
- invalid_format error code added

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Key corrections:
- Tool schema is flat (no nested "function" key)
- tool.call args field is a dict, not a JSON string
- tool.result must be sent in reply.done handler, NOT in tool.call
- Accumulate pending_tools, send all on reply.done
- On interrupted reply, discard pending_tools
- Handle both "error" and "session.error" event types
- Replaced quickstart with complete verified-working example

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

- Remove Warning about audio before session.ready
- Remove reply.create (not commonly needed)
- Remove reply.cancel (not commonly needed)
- Remove reply.interrupted — interruptions come via reply.done status:interrupted
- Add status field table to reply.done

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

…l plugin usage

Removed cards linking to U3 Pro docs (wrong product).
Added tabbed code blocks with real Pipecat and LiveKit S2S integration examples.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

… and LiveKit

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

@dan-ince-aai dan-ince-aai marked this pull request as ready for review March 13, 2026 22:07
@github-actions
Copy link

@LeeVaughn LeeVaughn merged commit 0e95df7 into main Mar 13, 2026
4 checks passed
@LeeVaughn LeeVaughn deleted the dan/s2s-docs branch March 13, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants