Recipe 1 — Outbound speech-to-speech agent on a PSTN call
Dial a number. Bridge a speech-to-speech model at the moment the callee answers. Let ClutchCall own turn-taking for the whole call. This is the canonical inference app. There is no ASR/LLM/TTS pipeline to wire: one model, one connection.1
Create the client
One tenant token authorizes the call control and the agent leg.
2
Originate with the agent inline
Pass
agent to originate. This bridges the model when the callee
answers, with no second round-trip.3
Follow the call to completion
The model drives the conversation. You only watch status.
Recipe 2 — A barge-in profile tuned per transport
Barge-in behavior that feels good on a browser leg (fast, cut-on-first-frame) triggers itself on a raw PSTN leg. On that leg, the agent reads its own echo as caller speech. Select the turn-detection profile from the leg type at attach time.Two settings change with the transport.
bargeConfirmMs sets how long
speech must continue before the agent is cancelled. ttsGuardMs sets how
long the mic gate stays raised after the agent sends audio. On a no-AEC leg,
raise both so that the agent’s own voice cannot trigger barge-in. On an AEC
leg, lower both for a fast interrupt.Recipe 3 — Measure turn latency on a live call
Turn latency is the time from end-of-user-speech to the first agent audio-out frame. It is the number that defines “responsiveness.” Tap the audio bridge beside the agent. Mark the last inbound frame. Measure the time to the first outbound frame.1
Attach the agent and a passive bridge
The agent drives the conversation. The bridge is a read-only tap on both
legs.
2
Detect end-of-speech locally
Track when caller frames stop for longer than the silence threshold. That
approximates the turn detector’s commit point.
3
Time to the first agent frame
The first downlink frame after a closed turn marks start-of-agent-speech.
4
Report the tail, not the mean
p95 / p99 is the product story. A good mean with a bad tail still feels
broken.
Recipe 4 — Hand off from the model to a human
Run the speech-to-speech agent first. Then transfer to a live agent when the caller asks. The model leg detaches. The call continues on the new leg.transfer performs a SIP REFER (or an HTTP fallback) to hand off the live
audio. The original sid stays in history. The new leg gets its own sid. The
speech-to-speech agent stops driving the conversation at the moment the
transfer completes.Recipe 5 — Speech-to-speech agent with a tool call
Give the agent a tool, and the conversation gains actions. In this example, the model handles a support call. When the caller asks about an order, the model calls an HTTPlookup_order tool. It gets the status back and speaks
the answer, all inside one natural conversation. ClutchCall runs the HTTP
call and feeds the result back to the model. You write zero glue.
1
Create the client
One tenant token authorizes call control, the agent leg, and the tool call.
2
Define the agent with an HTTP tool
Declare the model leg, the turn-detection policy, and a
lookup_order
tool. The tool’s description and parameters JSON-schema are what the
model sees. The url substitutes {{order_id}} from the arguments that
the model fills in.3
Originate the call with the agent inline
Pass
agent to originate. This bridges the model, and its tool, at the
moment the callee answers.4
The model calls the tool mid-conversation
There is nothing else to wire. When the caller says “where’s my order
A-123?”, the model decides to call
lookup_order. ClutchCall sends the
HTTP request. The structured result comes back as a tool_result, and the
model speaks it: “Order A-123 shipped this morning, it’ll arrive
Thursday.” You only watch status.On a failed lookup, return a non-2xx status with a structured body (for
example,
{ "error": "order_not_found" }). The model receives that as the
tool result. It recovers instead of stalling: “I couldn’t find that order,
can you re-read the number?” See the
cookbook for the error pattern. See
Agent DAGs for the full operator tool spec.Related
- Inference — Details — the commit gate, codecs, and turn-latency metric
- Inference — Cookbook — short single-task snippets
- Voice — Recipes — call control patterns this builds on

