Live agent mode
Your own AI agent holds a real-time spoken conversation on a Landline.sh call. Your agent is the brain; Landline is the ears and the voice. Landline streams the call audio to its speech service, detects when the caller finishes a sentence, transcribes it, sends the text to your agent over HTTPS, and speaks the reply. If the caller talks over the reply, playback stops and Landline listens. Back to API and MCP.
This is different from AI voice agents, where Landline hosts the model and you write instructions. In live agent mode Landline never sees your prompt or model; it only sends the caller's words and plays yours.
Start it
On an outbound call, add live_agent to POST /api/v1/calls (MCP: place_call). The call passes the same human gates as any other call: policy, approval, allowlist, budget, and compliance.
curl https://landline.sh/api/v1/calls \
-H "Authorization: Bearer $LANDLINE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155550142",
"live_agent": {
"agent_url": "https://agent.example.com/landline/turn",
"secret": "'"$LANDLINE_AGENT_SECRET"'",
"voice": "en_US-kathleen-medium",
"language": "en-US",
"greeting": "Thanks for calling Acme. How can I help?"
}
}'To answer inbound calls on one of your numbers, save the same object on the number (MCP: set_live_agent, get_live_agent, clear_live_agent). It needs the agents:write scope. An AI voice agent attached to the number takes precedence, so detach it first.
curl -X PUT https://landline.sh/api/v1/numbers/$NUMBER_ID/live-agent \
-H "Authorization: Bearer $LANDLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_url": "https://agent.example.com/landline/turn", "secret": "'"$LANDLINE_AGENT_SECRET"'"}'- agent_url: a public HTTPS URL, up to 512 characters. Private, loopback, link-local, and cloud metadata addresses, .local and .internal names, plain http, and URLs with credentials are refused when you save them and again on every turn, against the address actually connected to.
- secret: 24 to 128 characters you choose. Landline signs every turn with it and never returns it.
- voice: en_US-kathleen-medium (default), en_US-joe-medium, en_GB-alba-medium, or en_GB-cori-medium. language: en-US (default) or en-GB.
- greeting: up to 200 characters, spoken first. Callers always hear that they are talking to an automated AI assistant; Landline adds that sentence if your greeting doesn't say so.
What your agent receives
One POST per caller turn, signed exactly like Landline webhooks:
POST https://agent.example.com/landline/turn
Content-Type: application/json
X-Landline-Timestamp: 1798000000
X-Landline-Signature: v1=5c0e…
X-Landline-Session-Id: ls_…
{"call_id":"…","language":"en-US","session_id":"ls_…","text":"What time do you open tomorrow?","ts":"2026-12-02T10:00:00.000Z","turn":1}Answer within 5 seconds with JSON of at most 64 KB. Redirects are not followed. Set end_call to true to say reply and then hang up.
200 OK
Content-Type: application/json
{"reply": "We open at 9 tomorrow. Anything else?", "end_call": false}Verify the signature over the raw body before parsing it:
import crypto from "node:crypto";
export function verifyLandline(rawBody, headers, secret) {
const ts = headers["x-landline-timestamp"];
const sig = headers["x-landline-signature"] ?? "";
if (!ts || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const expected = "v1=" + crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
}If your agent fails or times out, the caller hears a short apology and can try again. After three failures in a row the call ends. Treat text as untrusted input from a stranger, not as instructions.
Transcripts and events
Both sides of the conversation are saved to the call: read them with GET /api/v1/calls/:id/transcript (MCP: get_transcript). Replies the caller talked over are marked interrupted. When the session ends, a signed call.live_agent.ended event with the end reason, duration, and number of turns goes to your event webhooks.
How it works
- Twilio sends the call audio to Landline's speech service over a WebSocket. The link is signed, expires 10 minutes after it is issued, works once, and carries your agent URL and secret only in encrypted form.
- The speech service runs open-source models on Landline's own server, on CPU: Silero VAD for turn detection and barge-in, Whisper (faster-whisper base) for transcription, and Piper voices trained on openly licensed (CC0 or CC BY 4.0) recordings. Audio is not sent to a third party, and the speech service does not store or log audio or transcripts.
- Measured on synthetic speech over a simulated phone stream with a 4-vCPU budget: the first reply audio starts about 1 second after the caller stops talking (median, with an instant agent; about 1.3 seconds with three calls at once). That includes the 0.7 seconds of silence that marks the end of a turn. Talking over a reply stops it about 0.3 to 0.4 seconds into continuous speech. A short word followed by a pause, like “Wait, …”, doesn't count on its own, so the reply stops once the caller keeps talking (about 1.2 seconds in our test).
Limits
- English only for now. A call lasts at most 10 minutes. At most 3 live sessions per workspace run at once; extra inbound callers go to voicemail if it is on, otherwise they hear a short unavailable message.
- Your agent's response time adds directly to the pause the caller hears. Keep replies short; the first sentence starts playing before the rest is rendered.
- Transcription can mishear names, numbers, and noisy lines. Confirm anything important with the caller.
- Billed at the normal voice rate. Outbound calls still need a person's approval in the dashboard. Not an emergency service, and not for one-time passcodes or verification bypass.