Voice
Calls that speak, listen and report back.
Place an outbound call with one request. It can say a message, play your audio and collect the keys the person presses, then tell your app how it went.
$0.0021/min
Lowest live rate, Mexico
6
Languages a call can speak
$0
For a call nobody answers
Overview
An outbound call, scripted in the request
Voice places calls from your app to any phone. You decide what the call does when it is answered, in order: speak, play, gather digits, pause and hang up. The switch runs that script on its own and reports each step back.
At a glance
- Place a call
- POST /comms/calls
- Follow it
- GET /comms/calls/{id}
- Modes
- Wait for the outcome, or async with webhooks
- Auth
- Bearer API key, scope voice:send
- Longest call
- Up to 3,600 seconds, default 300
- Throughput
- 10 call requests a second per key
Capabilities
What a call can do
A small, dependable set of steps, decided before the number is dialled.
Speak
Up to 500 characters per step and 1,500 per call, in English, Spanish, French, German, Portuguese or Hindi. Speech is not charged extra.{ "say": "…" }
Play your audio
An MP3 from your HTTPS address, up to 2 MB. We fetch it once before the call, so a slow host can never stall a live call.{ "play": "https://…/file.mp3" }
Collect keypad digits
Ask a question by speech or audio and collect 1 to 20 digits, with a timeout, a finish key and up to three tries. The digits come back on the call record and by webhook.{ "gather": { "say": "…", "digits": 1 } }
Async or blocking
Wait for the outcome in one request, or pass async and get a call ID at once with a status URL, then follow it by webhook.async: true answers 202
Routing per call
Smart Routing picks a route for the destination by cheapest, best_quality or balanced, or you pin a route you bought on the marketplace.strategy or routeId
Inbound on your numbers
Numbers you hold answer with an IVR menu, business hours, voicemail with transcription, recording and forwarding to a phone or your SIP server.PUT /dids/{id}/features/ivr
Safe retries
Send an X-Idempotency-Key and a retried request returns the first call instead of dialling twice.X-Idempotency-Key header
Test keys that never dial
A test key runs validation, routing and pricing on the real path and simulates the call, so nothing rings and no real balance moves.px_test_sk_ keys
Script a call
Ask a question, collect the answer
The call below asks for one key press, thanks the person and hangs up. With async it returns at once and reports each step by webhook.
- Actions run in order once the call is answered. hangup must be last; a call can carry up to 10 actions and 5 gathers.
- The digits pressed arrive in the call.gathered webhook and on GET /comms/calls/{id}.
curl -X POST https://packetexchange.io/api/v1/comms/calls \
-H "Authorization: Bearer $PACKETEXCHANGE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)" \
-d '{
"to": "+447700900123",
"from": "+14155550199",
"async": true,
"actions": [
{ "gather": { "say": "Press 1 to confirm your delivery.", "digits": 1 } },
{ "say": "Thank you. Goodbye." },
{ "hangup": true }
]
}'import { randomUUID } from 'node:crypto';
const res = await fetch('https://packetexchange.io/api/v1/comms/calls', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PACKETEXCHANGE_API_KEY}`,
'Content-Type': 'application/json',
'X-Idempotency-Key': randomUUID(),
},
body: JSON.stringify({
to: '+447700900123',
from: '+14155550199',
async: true, // answer at once; follow the call by webhook or GET
actions: [
{ gather: { say: 'Press 1 to confirm your delivery.', digits: 1 } },
{ say: 'Thank you. Goodbye.' },
{ hangup: true },
],
}),
});
const { data } = await res.json();
console.log(data.callId, data.status); // "ringing"import os, uuid
import httpx
res = httpx.post(
"https://packetexchange.io/api/v1/comms/calls",
headers={
"Authorization": f"Bearer {os.environ['PACKETEXCHANGE_API_KEY']}",
"X-Idempotency-Key": str(uuid.uuid4()),
},
json={
"to": "+447700900123",
"from": "+14155550199",
"async": True, # answer at once; follow the call by webhook or GET
"actions": [
{"gather": {"say": "Press 1 to confirm your delivery.", "digits": 1}},
{"say": "Thank you. Goodbye."},
{"hangup": True},
],
},
)
data = res.json()["data"]
print(data["callId"], data["status"]) # "ringing"Response, 202 Accepted
{
"callId": "…",
"status": "ringing",
"mode": "async",
"actions": 3,
"statusUrl": "/api/v1/comms/calls/…"
}The simplest call
Or place a call and wait for its outcome
Leave out async and the request returns when the call ends, with the status, the billable seconds and the cost.
- Allow a client timeout longer than maxDuration when you wait for the outcome.
# The request returns when the call ends, so allow longer than maxDuration.
curl -X POST https://packetexchange.io/api/v1/comms/calls \
-H "Authorization: Bearer $PACKETEXCHANGE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)" \
--max-time 120 \
-d '{
"to": "+14155550100",
"from": "+14155550199",
"strategy": "cheapest",
"maxDuration": 60
}'import { randomUUID } from 'node:crypto';
const res = await fetch('https://packetexchange.io/api/v1/comms/calls', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PACKETEXCHANGE_API_KEY}`,
'Content-Type': 'application/json',
'X-Idempotency-Key': randomUUID(),
},
body: JSON.stringify({
to: '+14155550100',
from: '+14155550199',
strategy: 'cheapest',
maxDuration: 60,
}),
// The request returns when the call ends.
signal: AbortSignal.timeout(120_000),
});
const { data } = await res.json();
console.log(data.status, data.billableSeconds, data.cost);import os, uuid
import httpx
res = httpx.post(
"https://packetexchange.io/api/v1/comms/calls",
headers={
"Authorization": f"Bearer {os.environ['PACKETEXCHANGE_API_KEY']}",
"X-Idempotency-Key": str(uuid.uuid4()),
},
json={
"to": "+14155550100",
"from": "+14155550199",
"strategy": "cheapest",
"maxDuration": 60,
},
timeout=120.0, # the request returns when the call ends
)
data = res.json()["data"]
print(data["status"], data["billableSeconds"], data["cost"])Carrier routes
Every call on a route you can see
Each voice route on the marketplace lists its rate, billing increment and caller ID type. Pick by strategy per call, or buy a route and pin it.
Webhooks
Events, signed and retried
Subscribe once and follow every call from the first ring to the final second.
Each delivery carries X-PX-Signature, v1= followed by an HMAC SHA-256 of the timestamp and the raw body. Failed deliveries are retried with a growing back-off and can be resent.
- call.ringingThe call was handed to the switch and is being dialled.
- call.answeredThe person picked up and the script started.
- call.gatheredDigits collected by a gather step, one event per gather.
- call.completedThe call ended, with status, billable seconds and cost.
- number.call.receivedA call arrived on a number you hold.
- number.voicemail.receivedA caller left a voicemail on one of your numbers.
Pricing
Per second of a connected call
A call is billed for its billable seconds at the rate of the route that carried it, in that route's billing increment, plus a platform fee of 2% of the carrier cost that never exceeds $0.001 a call. Unanswered calls cost nothing.
- Account and API keys
- Free
- Unanswered or failed call
- Free
- Speech and digit collection
- No extra charge
- Platform fee
- 2% of carrier cost, at most $0.001 a call
- Top up
- From $5 by card or crypto
Lowest live rates right now, per minute
- India mobile$0.007878 /min
- Nigeria mobile$0.0160 /min
- Philippines mobile$0.0250 /min
- Bangladesh mobile$0.011425 /min
- Mexico$0.0021 /min
- United Kingdom mobile$0.0260 /min
- United States$0.0060 /min
Live rates are the cheapest listed route for an ordinary number in each destination, read from the marketplace as this page was served.
In production
Built for production
A call that carries its own script runs the same way every time, whatever happens on your side.
- Nothing to hostThe script travels with the request, so a call speaks, gathers and ends cleanly even while your servers are deploying.
- The outcome in one replyWait for the call to end and get the status, duration and exact cost in one response, or pass async and follow it by webhook.
- Speech at no extra costsay steps are rendered before dialling in six languages and are not charged on top of the route.
- Caller ID you can checkEvery route states its caller ID type, and a caller ID test shows what a real handset in the destination displays.
- Unanswered calls are freeYou pay for answered time only, rounded to the route billing increment, with a platform fee that never exceeds $0.001 a call.
- A sandbox on the real pathTest keys validate the request and the actions and simulate the call against sandbox credit, so nothing rings.
Moving over
Your call flows map across, verb by verb.
Coming from Twilio
The names you know, mapped
TwiML becomes a short list of actions that travels with the call. The move-over guide maps every verb.
Twilio is a trademark of Twilio Inc. PacketExchange is not affiliated with or endorsed by Twilio.
Questions
Voice, answered
How is a call billed?
What happens with the key someone presses?
Which languages can a call speak?
What caller ID will people see?
Can I take inbound calls?
Can I test without dialling?
Keep reading
- Voice APIThe quick tour, with live per-minute prices
- Make a call quickstartYour first call, with samples in eight programming languages
- API referenceEvery field of the calls endpoints
- AI voice agentsAgents that make outbound calls for you
- SIP trunkingConnect your phone system to the same routes
- Moving from TwilioVoice, step by step
Place your first call today
Free account, an API key on sign-up and carrier rates from the first second. No contract and no monthly fee.
Prefer to talk it through? Contact the team.




