Skip to content

PyAI AMD · Answering-party detection

Know who answered.
Choose the next move.

A person, a voicemail box or an AI screener needs a different response. AMD gives your dialer the class, the subtype and the reason, so the next moment fits the call.

Keep your carrier. Start with Twilio-compatible outcomes.

The first few momentsSample decisions

answered_by

machine
subtype: screening

“Please say your name and why you are calling.”

Your next move

Introduce the caller and the reason for calling. Let the screening assistant hand the conversation to the person.

Illustrative examples of supported outcomes. No audio is analyzed and no call is made here.

AI screeners have their own outcome
Human-safe operating point
A reason with every decision

The beginning changes the conversation

An AI answers the phone.
Your dialer should know.

Google Call Assist and iPhone Call Screening can pick up before the person does. The screening subtype lets you introduce the caller and the purpose, instead of pitching into a transcript.

45/45

Google Call Assist screeners caught on real harvested calls

0/182

False screening fires across 32 gatekeepers and 150 human calls

~940 ms

Earlier at the median than Twilio AMD on the same 200 real calls

0/1,341

Live people marked as machines where both engines committed to an answer

Our own measurements on real customer traffic, not an SLA or a vendor benchmark. Screening figures come from retained live-dialing captures; no iPhone screening recall figure is claimed. Latency is one side-by-side run of 200 answered calls replayed at real-time pace against Twilio AMD’s recorded decisions. The 1,341-call comparison found six live-person errors from Twilio AMD and zero from PyAI AMD.

Read the full comparison and measurement context

More than person or machine

Every outcome.
A different next move.

The class and subtype give your routing logic room to respond. Keep your existing AnsweredBy branches, then use the richer fields when you are ready.

human

Connect the agent.

machine
/ screening

An AI screener answered. Say who you are and why. Do not run the pitch into a transcript.

machine
/ voicemail

Wait for the beep, drop the message, move on.

machine
/ ivr

An auto-attendant or phone tree. Navigate it or route to the right queue; do not leave a message on a menu.

machine
/ music

Hold music or a musical greeting with no words. Treat as a machine; it cannot fire on anyone who spoke.

sit_invalid
/ dead_number

The carrier's intercept says the number is dead. Scrub it from the list instead of retrying it.

fax

Fax tone on the line. Drop and flag the record.

unknown

No decisive evidence inside the window. Your default, and you set it.

Fit it into the call you already run

One stream.
Your existing call flow.

For Twilio, add a Media Stream and your server-side key. PyAI authenticates before processing audio and returns decisions on the same socket and to your webhook.

  • Twilio Media Streams wire format
  • Class, subtype and Twilio-compatible AnsweredBy
  • A decision window you can configure
Read the AMD guide
TwiML · add to your existing call flow
<Response>
  <Start>
    <Stream url="wss://api.pyai.com/v1/amd/stream">
      <Parameter name="api_key" value="YOUR_PYAI_KEY"/>
      <Parameter name="aggressiveness" value="0.25"/>
      <Parameter name="webhook" value="https://you/amd-events"/>
    </Stream>
  </Start>
  <!-- Standalone test: replace this pause with your existing call flow. -->
  <Pause length="30"/>
</Response>

This example waits for 30 seconds as a standalone test. Replace the pause with your existing call flow. Keep keys on the server.

Works with the way you dial

Keep the carrier.
Connect the stream.

Twilio

One line of TwiML

SignalWire

Twilio-format streams

Telnyx

Twilio-format streams

Plivo

Stream bridge

Vonage

Stream bridge

Genesys

Stream bridge

RingCentral

Stream bridge

Amazon Connect

KVS bridge

Platforms that speak Twilio’s stream format connect directly. Platforms with their own format use a server-side bridge to forward frames; Amazon Connect uses Kinesis Video Streams. Compatibility is not endorsement. All trademarks belong to their owners.

A decision with a receipt

Read the reason.
Understand the branch.

The reason field describes the evidence behind the outcome. The Twilio-compatible field lets existing routing continue while you decide how to use the class and subtype.

Illustrative AMD event · supported response fields
{
  "event": "amd",
  "call_id": "CA7d0…",
  "answered_by": "machine",
  "subtype": "screening",
  "answered_by_twilio": "machine_start",
  "confidence": 0.97,
  "decision_ms": 720,
  "reason": "AI call-screener: 'call assist' @720ms"
}

Your operating point

Choose when to decide.

Set aggressiveness from 0 to 1 to choose the operating point. A shorter decision budget can increase unknown outcomes. A human-safe default avoids guessing machine when the available evidence is inconclusive.

decision_ms measures processed audio; decision_elapsed_ms measures elapsed decision time. Webhook delivery takes additional time.

From exploring to building

Set the operating point.
Take the code.

Change the configuration and copy a matching account-settings request. Review it on your server before applying it; this page does not change an account or start a call.

Set your detection operating point.

Generate the request to update your account's AMD defaults. Apply the copied code on your server when you are ready.

Near 0 favors passing people through; near 1 favors faster machine detection.

Leave blank to keep your existing webhook setting.

POST /v1/amd/config

const response = await fetch("https://api.pyai.com/v1/amd/config", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PYAI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "aggressiveness": 0.25
  }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());

// Updates account defaults. Connect your carrier's stream to /v1/amd/stream to classify call audio.

Code updates here without sending a request. Run the copied example on your server with PYAI_API_KEY.

Copy the code to use these settings, or explore the full product workspace.

A little more detail

Good questions.
Clear answers.

First 5,000 answered calls each month free, then $0.004 per answered call. AMD is included when the call already runs on PyAI Telephony. See current pricing and terms.

See current rates
Explore managed Telephony
How do you know the screening detection works?

We harvest real screened calls out of live traffic and keep the audio and transcript. On the Google Call Assist captures the screening outcome fires on 45 of 45, with zero false fires across 32 human gatekeepers and 150 ordinary human calls. Google screeners announce themselves in a near-closed vocabulary, which is why this is a high-precision problem rather than a guess. iPhone Call Screen detection ships too, matched on the prompts Apple's assistant uses, but we have not caught enough organic iPhone screeners in the wild to publish a recall number for it, so we do not.

Will it hang up on a live person?

That is the one failure that costs you a customer, so the design is bent around it. The thresholds are asymmetric on purpose, and the rules that fire machine from audio alone are gated so they cannot fire on someone who spoke. In our side-by-side on 1,341 real calls where both engines committed to an answer, Twilio AMD marked a live person as a machine 6 times; PyAI AMD did 0. We publish that number rather than claim never. When the window expires with nothing decisive, the human-safe default hands you unknown and lets the agent listen instead of guessing machine.

Which telephony platforms does PyAI AMD work with?

Any platform that can fork call audio to a WebSocket. The endpoint speaks Twilio's Media Streams wire format natively, so Twilio is one line of TwiML, and SignalWire and Telnyx speak the same stream format. Plivo, Vonage, Genesys, and RingCentral fork call audio from their own media streaming features through a thin server-side bridge that forwards the frames; Amazon Connect reaches it the same way via Kinesis Video Streams. Server-side integrations authenticate with ?api_key= on the URL or the pyai-key subprotocol.

How is PyAI AMD billed?

Per answered call. The first 5,000 answered calls each month are free, then $0.004 per answered call. Calls that never get answered are not billed, and AMD is included at no charge when the call already runs on PyAI telephony.

Do I have to change my routing logic to leave Twilio AMD?

No. Every decision carries answered_by_twilio, which maps to Twilio's exact AnsweredBy enum, next to our own answered_by class and subtype. Route on the Twilio field on day one, then read subtype when you are ready to act on screening, IVRs and dead numbers.

How fast is the decision?

We do not publish an absolute latency SLA. What we measured: on 200 real answered calls replayed at real-time pace through the live endpoint, PyAI's decision landed about 940 ms earlier at the median than Twilio AMD's recorded decision on the same calls, and about 1.5 s earlier on the calls a person answered. Our own measurement on one run, not a guarantee. decision_ms measures processed audio; when you set a decision timeout, decision_elapsed_ms measures elapsed time to prepare the result. Webhook delivery takes additional time.

Can I limit how long AMD waits?

Yes. Set decision_timeout_ms on the stream to 3000 for a three-second decision budget or 5000 for five seconds; the supported range is one to fifteen seconds. The clock starts when PyAI accepts the authenticated start. Earlier decisions return immediately; if the evidence available at the cutoff is inconclusive, AMD returns unknown instead of guessing. Shorter budgets can increase unknowns. Allow additional time for webhook delivery.

Know the beginning. Shape what follows.

Point a call at it.
Read the reason.