Endpoint:
wss://api.pyai.com/v1/amd/stream (scope amd:detect).
Config: POST /v1/amd/config (scope amd:configure). Reads:
GET /v1/amd/calls, GET /v1/amd/calls/{id} (scope amd:read).
Billed per answered call, the first 5,000 answered calls/month are free,
then $0.004/call; free when bundled with PyAI telephony or Omni.The wedge: a zero-code Twilio migration
AMD speaks Twilio’s Media Streams protocol natively (start / media /
stop frames, G.711 μ-law 8 kHz base64), so a customer already on Twilio adds
one line of TwiML, no carrier change, no new SDK, to fork the call’s media
to PyAI:
<Stream>, so the key rides the
URL as ?api_key= (the standard server-side WS auth). Your own server-side
clients may instead use the Sec-WebSocket-Protocol: pyai-key.<API_KEY>
subprotocol.
The decision
PyAI pushes anamd event mid-call (and to your webhook) so a predictive
dialer can route or drop instantly:
| field | meaning |
|---|---|
answered_by | PyAI’s richer vocabulary: human, voicemail, live_voicemail, screening (iPhone/Google Call Screen), ivr, human_gatekeeper, sit_invalid (dead/disconnected number), fax, silence, unknown |
answered_by_twilio | Twilio’s exact AnsweredBy enum, so a drop-in keeps its routing logic unchanged |
confidence | 0-1 |
decision_ms | latency from answer to decision |
reason | the word-level evidence, something Twilio can’t give you |
GET /v1/amd/calls/{id}.
The one dial: aggressiveness
AMD has a single operating-point dial, aggressiveness ∈ [0, 1], set per account
(POST /v1/amd/config) or per call (a TwiML <Parameter>):
- 0.0-0.25, human-safe (default). Never hang up on a person. For predictive
dialers with live agents; on the deadline it returns
unknown(let the agent listen) rather than risk a falsemachine. - 0.6-1.0, machine-aggressive. Fire
machinefast, for AI voicemail-drop bots.
machine (hang up on a prospect) is far
worse than a false human (waste a few agent-seconds), so you pick your point on
the curve instead of living with one fixed default.
Set it up with the SDK
Two ways to turn it on
- Twilio drop-in, the TwiML above. Keep your carrier and your code; the
answered_by_twiliofield speaks Twilio’s exact vocabulary. - Native, a flag on any call already running on PyAI telephony or Omni. Bundled AMD is included at no charge.
Billing
Billed per answered call (amd.calls): no-answers, busies, and failed calls
are free, the same basis as Twilio. The first 5,000 answered calls each month are
free (a self-serve “get started free” tier), then $0.004/answered call. AMD
bundled with PyAI telephony or Omni is included. Because AMD decides in a fraction
of the incumbent’s dead-air dwell, you also pay for fewer carrier call-seconds.