voice.agents.attach. You configure
turn detection and the model codec. Optionally, you tap the audio bridge. This
page is the inference-relevant slice of the Voice SDK plus the turn-detection
knobs.
A dedicated typed
Inference client is Preview. See the bottom of this
page. For shipping code today, use the Voice surface documented here.Import
The agent path lives on thevoice subpath:
- TypeScript
- Python
voice.agents.attach
Bind a speech-to-speech agent to a live call or a just-originated call. The
runtime bridges the call’s uplink / downlink audio tracks to the model. It
owns turn-taking for the duration of the call.
- TypeScript
- Python
string
required
The call sid to bind the agent to, from
originate() or an inbound answer.string | AgentSpec
required
Either an agent id (string) registered in the control plane, or an inline
agent spec. The spec selects the speech-to-speech model and its
turn-detection config.
Promise<void>. It resolves after the agent is bridged. Audio
starts to flow immediately. Turn detection gates the first agent utterance.
Attaching at originate time
originate accepts an agent directly, so the common case is one call:
- TypeScript
- Python
The agent spec
An inlineAgentSpec selects the model leg and the turn-detection policy. The
shape mirrors the agent config that the control plane stores.
ClutchCall resamples between the caller leg rate (commonly 8 kHz on PSTN)
and the model’s inputRateHz / outputRateHz. You set the model’s rates.
The bridge handles the caller leg.Turn detection
TheTurnDetection block is the heart of this modality. It owns the
client-commit gate, backchannel suppression, and hold-and-confirm barge-in.
Put it in the agent spec, or set it server-side in the agent config.
Tools
Declare function-calling tools on the agent. The model can then invoke them mid-conversation. ClutchCall runs the call and feeds the structured result back to the model. Put atools array in the agent spec. The shape mirrors
the operator tool config that the control plane stores. See
Agent DAGs for the full operator spec.
"http" | "mcp" | "client"
required
http calls an arbitrary HTTP(S) endpoint. mcp sends a JSON-RPC 2.0
tools/call to a remote MCP server. client is scaffolded. The tool is
advertised and the call is parsed, but invoke returns not_yet_plumbed
today.string
required
The tool name that the model sees. It must be unique per agent. On a name
collision, it overrides a built-in telephony tool of the same name.
string
required
Plain-language description of what the tool does and when to use it. This is
what the model reasons over when it decides to call the tool.
boolean
default:"false"
When
false, the model can narrate the call (“let me look that up”). When
true, it stays quiet until it has the result.string
required
HTTP method, for example
GET or POST.string
required
Endpoint URL. Supports
{{argument}} substitution from the model’s tool
arguments, for example https://api.example.com/orders/{{order_id}}.Record<string, string>
Request headers. Values support the same
{{argument}} substitution as the URL.ToolAuth
{ type: "bearer", token }, { type: "basic", user, pass }, or a custom
header { type: "header", name, value }.JsonSchema
required
A JSON-schema object (
type / properties / required) that describes the
tool’s arguments. The model fills these in. They drive the {{argument}}
substitution.number
default:"10000"
Per-call timeout in milliseconds. Invokes run synchronously within the model
turn, so keep this tight.
Every agent also advertises a set of built-in telephony tools (transfer,
hold, DTMF, and more) with no configuration. Tools that you declare here are
operator tools. They override a built-in tool on a name collision.
Tapping the audio bridge (optional)
You usually do not touch raw frames. The runtime bridges the model leg for you. When you need to observe or inject audio (a recording sidecar, custom DSP), attach the VoiceAudioBridge to the same call.
- TypeScript
- Python
AudioBridge methods relevant here:
See Voice — SDK Methods for the full
AudioBridge surface.
Events
The agent leg shows turn-boundary and barge events through the call’s status stream. Subscribe with the Voice call handle:- TypeScript
- Python
Preview: a dedicated typed Inference client
Preview. A standalone
Inference client is in design. It is a typed
handle that wraps agent attach, the commit gate, and audio bridging behind
one object. The shape below is forward-looking and can change. For
shipping code, attach via voice.agents.attach as shown above.Related
- Inference — Details — wire model, the commit gate, turn-latency metric
- Inference — Cookbook — short task snippets
- Voice — SDK Methods — the full call + audio-bridge surface

