Voice API
Outbound calls from code, at wholesale rates
One POST places the call on a carrier route and, when it ends, answers with the outcome, the billable seconds and the exact cost.
- Exact cost in every reply
- No charge without billable time
- AI agents at $0.25 per AI minute
Live from the marketplace
Price the exact number you will dial
Type any number in international format. Every live route that serves it comes back with its rate, billing increment and caller ID type, cheapest first.
11 routes serve +13125887000, cheapest first
United States
30/6 billing · Full CLI
$0.0063/min
Canada
6/6 billing · Full CLI
$0.0070/min
Canada
6/6 billing · Local CLI
$0.0088/min
Not Applicable _Not Applicable-1
1/1 billing · Full CLI
$0.027347/min
USA
6/6 billing · Full CLI
$0.0498/min
What the voice API does
Calls, codes and agents on one key
The calls your product places, priced from a live wholesale market instead of a retail list, with every result reconciled to the cent.

One request, one finished call
POST /comms/calls dials, waits for hangup and answers with the status, duration, billable seconds, hangup cause and cost. A signed call.completed webhook follows.
Smart Routing on every call
Pass cheapest, best_quality or balanced and the call goes to the best route that serves the number. If that route refuses it, the next one is tried straight away, and only the one that connects is billed.
AI voice agents on outbound campaigns
Describe the agent in plain English, test it in a simulated call, then attach it to a campaign. A flat $0.25 per AI-connected minute, billed per second, on top of the call.
Spoken one-time codes
POST /comms/voice-otp reads a code aloud in English, Spanish, French, German, Portuguese or Hindi, then hangs up. It is billed as the short call it is.
Retries that never dial twice
Send an X-Idempotency-Key and a retried request replays the first answer for 24 hours instead of placing a second call.
How it works
Your first call in three steps
- Step 1
Create a key
Open a free account and create a live key and a test key. Limit either to the voice:send permission so it can call and do nothing else. - Step 2
Fund it and choose routing
Top up from $5 by card or crypto. Pass a strategy on each call, or name a route you bought on the marketplace. - Step 3
Call and reconcile
POST /comms/calls. The reply carries the outcome and cost, and the signed webhook lands on your endpoint with a delivery log and resend.
# 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"])Needs a live key and a funded balance. A test key runs the same routing and pricing checks, then simulates the call against invite-only sandbox credit.
One request with your key. The same call works from any language, and every endpoint is documented with its fields and errors.
Every endpoint in the API reference3,062routes live on the marketplace now
The market, live
213 destinations with a live route. Prepaid from $5, platform fee 2% capped at $0.001.
- Platform fee
- 2%, capped at $0.001
- Top up from
- $5, card or crypto
Test keys that walk the real path
A test call is validated, routed and priced on a real route, then simulated. Nothing is dialled and your live balance is never touched.
Keys scoped to the job
Give each service its own key with only the permissions it needs, and see requests, errors and latency per key.
Webhooks you can prove and replay
Every delivery is signed with an HMAC SHA-256 of its body and a timestamp, logged, and can be resent.
Agents can call too
The MCP server gives an AI agent tools to find routes, place calls, send SMS and check its balance on your key.
Questions
Voice API, answered
Anything else is in the help centre, or ask the team directly.
Do I need my own switch to place calls?
No. POST /comms/calls originates the call for you and returns the result when it ends. If you already run a softswitch or SBC, you can instead buy a route and point your switch at it with the SIP credentials that come with the purchase.
How is a call billed?
Talk time is rounded by the route's billing increment and multiplied by its per-minute rate, then a platform fee of 2% of that cost is added, capped at $0.001. Funds for the call's maximum length are held when it starts and the unused part is returned at hangup. A call with no billable time is not charged.
Can a call play audio, speak text or collect digits?
Yes, as a script you send with the call: say text in six languages, play an MP3, collect keypad digits, pause and hang up. The digits come back in the call record and a call.gathered webhook when the call ends. Pass async: true to get the call id straight away and follow it through ringing, answered and completed. Changing a call once it has started is not supported; two-way conversations use AI voice agents.
How do AI voice agents work, and what do they cost?
You describe the agent in plain English and it drafts its own script and rules for you to edit. Test it in a simulated call, then attach it to an outbound Dialer campaign on the routes you choose. It costs a flat $0.25 per AI-connected minute, billed per second, on top of the call, and only while an agent is on a live call.
What happens if a route refuses my call?
If your first route refuses a call, we try the next one straight away: your routing order for that number, else the next best route. Up to three routes are tried, only within the price limit you choose (by default a backup never costs more than your first route), and only the one that connects is billed. A wrong number, a busy line, a declined call or no answer is never retried. The reply names the route that carried the call and lists each attempt.
What caller ID will the person I call see?
Every voice route states its caller ID handling: Full CLI passes your number intact, Local CLI shows a local number, Mixed CLI is not guaranteed and No CLI does not carry it. A caller ID test places a real call to a handset and shows what it displayed.
Can I try it without spending money?
Test keys run the full request, routing and pricing included, and simulate the call against sandbox credit rather than your balance. Sandbox credit is added with an invite code. Pricing a number is public and free, with no key at all.
Can I receive calls as well?
Yes. Buy numbers and route each one to a SIP server, a hosted softphone login or any phone, with IVR menus, opening hours, voicemail and recording on every number.
Place your first call today
Free account, API key on signup and wholesale rates from the first call. No contract, no seats and no monthly fee.
