Base URL: https://agentnumber.com/api/v0
All API requests require a Bearer token. Get your API key from the dashboard after signing up.
Authorization: Bearer an_live_<your_key>
Three steps to give your agent a phone number:
Sign up at /signup, then create an API key in the dashboard.
{
"amount_cents": 1000
}$5 per number, $0.05/min outbound, $0.03/min inbound.
Option A: Managed mode — just provide a system prompt, no server needed:
{
"system_prompt": "You are a helpful sales assistant for Acme Corp.",
"first_message": "Hello, how can I help you?",
"area_code": "415"
}Option B: Webhook mode — route calls to your own server for full control:
{
"webhook_url": "https://your-agent.com/voice",
"area_code": "415"
}Your webhook_url receives POST requests in OpenAI-compatible chat completions format:
{
"model": "custom",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hi, I'd like to schedule an appointment." }
],
"stream": true
}Respond with SSE-streamed chat completion chunks. The text is spoken back via TTS.
data: {"choices":[{"delta":{"content":"Sure, I can"}}]}
data: {"choices":[{"delta":{"content":" help with that."}}]}
data: [DONE]/numbersProvision a new phone number
{
"system_prompt": "You are a helpful assistant.",
"webhook_url": "https://your-agent.com/voice",
"area_code": "415",
"voice_id": "cgSgspJ2msm6clMCkdW9",
"first_message": "Hello!",
"inbound_mode": "autopilot",
"metadata": {}
}/numbersList all your phone numbers
/numbers/:idGet a specific number
/numbers/:idUpdate number config
/numbers/:idRelease a phone number
/callsMake an outbound call
{
"from": "num_a1b2c3d4e5f6",
"to": "+15551234567",
"metadata": {}
}/callsList call history
/calls/:idGet call details
/calls/:id/transcriptGet call transcript
/calls/:id/recordingGet recording URL
/smsSend an outbound SMS
{
"from": "num_a1b2c3d4e5f6",
"to": "+15551234567",
"body": "Hello from my agent!",
"metadata": {}
}/smsList SMS messages
/sms/:idGet a single SMS message
/credits/balanceCheck your credit balance
/credits/purchasePurchase credits ($10.00 per pack)
Register webhooks to receive events. Payloads are HMAC-signed.
/webhooksRegister a webhook
/webhooksList webhooks
/webhooks/:idUpdate webhook
/webhooks/:idDelete a webhook
Available Events:
call.startedcall.endedcall.transcript.readycall.recording.readysms.sentsms.received{
"success": false,
"error": {
"message": "Insufficient credits.",
"code": "insufficient_credits"
}
}401 — Invalid or missing API key
400 — Validation error
402 — Insufficient credits
404 — Resource not found
500 — Internal error