WhoBuilt

Building voice agents with OpenAI

Jun 29, 2025· 1 h 26 min· 30K views·Watch on YouTube

Speaker

Dominik Kundel, who works on developer experience at OpenAI, presents a two-hour AI Engineer workshop on designing and building voice agents with the OpenAI Agents SDK for TypeScript.

Voice agent architectures

Kundel defines agents as models with instructions and tools, managed by a runtime. He compares chained systems, which convert speech to text and back, with speech-to-speech models that handle audio directly. Chaining is easier to adapt from existing text agents and offers visibility into text, while speech-to-speech can reduce latency and preserve cues such as tone.

Design for focused, testable conversations

Kundel demonstrates a speech-to-speech frontline agent delegating a refund decision to an o4-mini agent, then shows traces with audio, transcripts, tool inputs, and outputs. He recommends starting with one clear use case, a limited set of tools, and early evaluations and guardrails. Prompts can also shape personality and conversation flow.

Build and connect a browser agent

The workshop starts with a text agent, adds a weather tool with a Zod schema, then connects a real-time agent to a browser using WebRTC. A server-generated ephemeral key lets the browser connect without exposing the API key. The SDK handles audio and interruptions, and developers can inspect events and conversation history.

Add control and backend reasoning

Kundel recommends keeping tool calls fast, using task IDs for longer work, and requiring human approval where appropriate. Handoffs can switch an agent’s instructions and tools, while backend agents can handle more complex reasoning; a riddle tool delegates to an o4-mini agent. He also demonstrates transcript-based output guardrails, which can interrupt a response when a rule is violated.

Evaluate with real audio and human review

Kundel explains that realtime guardrails run against transcripts and may act after some audio has already been spoken. For evaluation, he recommends retaining audio because speech-to-speech models respond to audio rather than only text. Before customer interactions are available, teams can use human review and a predetermined set of examples, while keeping the agent’s scope clear.

Takeaways

  • Start with one narrow voice-agent task and only the tools it needs.
  • Use speech-to-speech when lower latency and audio context matter; use a chained design when reusing text agents is the priority.
  • Keep backend tool calls short, and delegate complex work to scoped agents.
  • Use server-generated ephemeral keys for browser connections to avoid exposing API credentials.
  • Build evaluations and guardrails early, and retain audio for reviewing speech-to-speech behavior.

Mentioned in this talk

Search inside this talk

What was claimed 9

  • works at
    Developer Experience & SDKs (Codex)
    “I work on developer experience at OpenAI”
    YouTube
    Verified4 sources· Talk, Web, GitHub· archived
  • launched
    container service
    “today we launched the OpenAI Agents SDK for TypeScript”
    YouTube
    Verified2 sources· Talk
  • feature
    OpenAI Agents SDK: Native voice agent support, handoffs, guardrails, streaming, tools, MCP support, tracing, and human-in-the-loop resumability
    “It comes with foundational features including handoffs, guardrails, streaming input and output, tools, MCP support, and built-in tracing”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI Realtime API: Supports WebRTC and WebSockets for real-time communication
    “There's support for both WebRTC and WebSockets”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI Realtime API: Speech-to-speech audio handling can reduce latency and retain audio context
    “much lower latency because we're skipping the speech-to-text and text-to-speech processes”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI Agents SDK: Tracing is enabled by default and can be disabled
    “In the Agents SDK, it's enabled by default, but you can disable it”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI Realtime API: The session maintains the source of truth for conversation context
    “the Realtime API holds the source of truth for the whole conversation”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI Realtime API: Audio output modes include μ-law, which can be useful for phone calls
    “there are different audio modes you can use, including μ-law”
    YouTube
    Unverified1 source· Talk
  • uses
    runs the delegated backend reasoning agent in the demo
    “We'll call it the Riddler ... We'll give it a model of o4-mini”
    YouTube
    Unverified1 source· Talk

Related talks