RealSpeak API Reference
Build empathic voice agents that understand human emotion in real-time. RealSpeak combines Hume EVI's 48-dimension prosody analysis with agentic tool execution to create voice AI that doesn't just respond — it understands.
Base URL
https://realspeak.ai/api/v1
Authentication
All API requests require authentication via a Bearer token. Generate API keys from the dashboard under Settings → API Keys.
curl https://realspeak.ai/api/v1/agents \ -H "Authorization: Bearer rs_live_sk_abc123..."
API keys use a rs_live_ prefix. Keys are SHA-256 hashed before storage — the full key is only shown once at creation.
Security: Never expose API keys in client-side code. All API calls should be made from your server.
Agents
Agents are the core of RealSpeak. Each agent has a personality (system prompt), voice, tools, and behavior settings.
List Agents
/api/v1/agentscurl https://realspeak.ai/api/v1/agents \
-H "Authorization: Bearer rs_live_sk_..."
# Response
{
"agents": [
{
"id": "ag_abc123",
"name": "Support Agent",
"voiceName": "Ito",
"llmModel": "claude-sonnet-4-5-20250514",
"active": true,
"phoneNumbers": [{ "id": "pn_1", "number": "+14155551234" }],
"tools": [{ "id": "tl_1", "name": "lookup_order" }],
"_count": { "callSessions": 47 },
"createdAt": "2026-04-01T00:00:00Z"
}
]
}Create Agent
/api/v1/agents| Parameter | Type | Description |
|---|---|---|
name* | string | Agent display name |
systemPrompt* | string | Instructions defining agent behavior |
llmModel | string | LLM model ID. Default: claude-sonnet-4-5-20250514 |
voiceName | string | Hume voice name (e.g. Ito, Kora, Serene Assistant). See GET /voices for full catalog. Default: Ito |
firstMessage | string | Greeting spoken when a call starts |
webhookUrl | string | URL to receive call events (HMAC-SHA256 signed) |
webhookSecret | string | Secret for HMAC signature verification |
backgroundNoise | string | Ambient audio: none, call_center, office, cafe. Default: call_center |
maxCallDurationSeconds | integer | Max call length in seconds. Default: 1800 (30 min) |
deadAirTimeoutSeconds | integer | Silence timeout. Default: 45 |
interruptionSensitivity | float | 0.0 (never interrupt) to 1.0 (very sensitive). Default: 0.5 |
recordingEnabled | boolean | Record calls via Telnyx. Default: false |
tools | array | Tool definitions (see Tool Calls section) |
curl -X POST https://realspeak.ai/api/v1/agents \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Support Agent",
"systemPrompt": "You are a helpful support agent for Acme Inc...",
"voiceName": "Kora",
"firstMessage": "Hi, thanks for calling Acme! How can I help?",
"webhookUrl": "https://yourapp.com/webhook",
"tools": [{
"name": "lookup_order",
"description": "Look up an order by ID or email",
"parameters": {
"type": "object",
"properties": {
"orderId": { "type": "string", "description": "Order ID" },
"email": { "type": "string", "description": "Customer email" }
},
"required": ["orderId"]
}
}]
}'Update Agent
/api/v1/agents/:idAccepts any agent field. Only provided fields are updated.
curl -X PATCH https://realspeak.ai/api/v1/agents/ag_abc123 \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{ "active": false, "voiceName": "Sebastian Lockwood" }'Delete Agent
/api/v1/agents/:idPermanently deletes the agent and all associated tool definitions. Call history is preserved.
Transfer & Escalation Settings
Agents support warm/cold call transfer and human escalation triggers based on emotion detection.
| Parameter | Type | Description |
|---|---|---|
allowHangup | boolean | Whether the agent can hang up calls. Default: true |
transferEnabled | boolean | Enable call transfer capability |
transferType | string | warm, cold, or agent. Default: warm |
transferDestination | string | Phone number or agent ID for transfers |
transferMessage | string | Message spoken before transfer |
humanEscalationEnabled | boolean | Auto-escalate to human on frustration |
humanEscalationNumber | string | Phone number for human escalation |
humanEscalationThreshold | float | Frustration score (0-1) that triggers escalation. Default: 0.7 |
Calls
Call sessions are created automatically when a call connects. Use these endpoints to query history.
List Calls
/api/v1/calls| Parameter | Type | Description |
|---|---|---|
agentId | string | Filter by agent |
limit | integer | Results per page (max 100). Default: 50 |
offset | integer | Pagination offset. Default: 0 |
# Response
{
"calls": [{
"id": "cs_xyz789",
"agentId": "ag_abc123",
"callerNumber": "+14155559876",
"channel": "phone",
"status": "completed",
"startedAt": "2026-04-19T14:30:00Z",
"endedAt": "2026-04-19T14:35:22Z",
"durationSeconds": 322,
"toolsUsed": ["lookup_order", "send_email"],
"dominantEmotion": "Joy",
"avgSentiment": 0.72,
"summary": "Customer called about order status..."
}],
"total": 147,
"limit": 50,
"offset": 0
}Get Call Detail
/api/v1/calls/:idReturns full call data including transcript, prosody timeline, and tool call details.
# Response includes:
{
"call": {
"id": "cs_xyz789",
"transcript": [
{ "role": "agent", "content": "Hi, how can I help?", "timestamp": 0 },
{ "role": "user", "content": "I need to check my order", "timestamp": 3.2 }
],
"prosodyTimeline": [
{
"timestamp": 3.2,
"emotions": {
"Joy": 0.12, "Anger": 0.02, "Sadness": 0.05,
"Interest": 0.68, "Confusion": 0.31
},
"dominantEmotion": "Interest",
"sentiment": 0.65
}
],
"toolsUsed": ["lookup_order"],
"summary": "Customer inquired about order ORD-456...",
"agent": { "id": "ag_abc123", "name": "Support Agent" }
}
}Phone Numbers
Purchase Telnyx phone numbers and assign them to agents. Each number routes inbound calls to its assigned agent.
Search Available Numbers
/api/v1/numbers/search| Parameter | Type | Description |
|---|---|---|
area_code | string | 3-digit area code (e.g. 415) |
city | string | City name |
state | string | 2-letter state code |
Purchase Number
/api/v1/numbers/purchasecurl -X POST https://realspeak.ai/api/v1/numbers/purchase \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{ "phone_number": "+14155551234" }'Assign to Agent
/api/v1/numbers/:idcurl -X PATCH https://realspeak.ai/api/v1/numbers/pn_123 \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{ "agentId": "ag_abc123" }'Release Number
/api/v1/numbers/:idRemoves the number from Telnyx. This action is irreversible.
Webhooks
RealSpeak sends HMAC-SHA256 signed webhook events to your agent's webhook URL during calls. Verify signatures using the X-RealSpeak-Signature header.
Signature Verification
import crypto from 'crypto';
function verifyWebhook(body: string, signature: string, secret: string): boolean {
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}call.started
Sent when a call connects. Your response can override agent config for this call.
// Incoming webhook payload
{
"event": "call.started",
"callId": "cs_xyz789",
"agentId": "ag_abc123",
"callerNumber": "+14155559876",
"timestamp": "2026-04-19T14:30:00Z"
}
// Your response (all fields optional)
{
"systemPrompt": "Override prompt for this caller...",
"firstMessage": "Welcome back, Sarah!",
"voice": { "provider": "HUME_AI", "name": "Kora" },
"tools": [{ "name": "vip_lookup", "description": "...", "parameters": {...} }]
}tool_call
Sent when the agent invokes a tool. You must return a result string. Optionally return actions like transfer or hangup.
// Incoming
{
"event": "tool_call",
"callId": "cs_xyz789",
"toolCallId": "tc_001",
"name": "lookup_order",
"parameters": { "orderId": "ORD-456" }
}
// Your response — simple result
{ "result": "Order ORD-456: shipped yesterday, tracking 1Z999AA..." }
// Or with action — transfer to human
{
"result": "Transferring to a specialist now.",
"action": "transfer",
"destination": "+14155550000"
}
// Or hangup
{
"result": "Thank you, goodbye!",
"action": "hangup"
}prosody.update
Real-time emotion data from Hume EVI after each user utterance. 48 emotion dimensions scored 0-1.
{
"event": "prosody.update",
"callId": "cs_xyz789",
"timestamp": "2026-04-19T14:31:15Z",
"emotions": {
"Joy": 0.03, "Anger": 0.67, "Frustration": 0.72,
"Sadness": 0.15, "Contempt": 0.41, "Disgust": 0.22,
"Interest": 0.08, "Surprise": 0.05, "Fear": 0.11,
"...": "48 dimensions total"
},
"dominantEmotion": "Frustration",
"sentiment": 0.18
}call.ended
Full call summary with transcript, prosody stats, tools used, and duration.
{
"event": "call.ended",
"callId": "cs_xyz789",
"agentId": "ag_abc123",
"callerNumber": "+14155559876",
"duration": 322,
"endedReason": "caller_hangup",
"transcript": "Agent: Hi, how can I help?\nUser: I need to check...",
"summary": "Customer called about order status. Issue resolved.",
"toolsUsed": ["lookup_order", "send_email"],
"prosody": {
"avgSentiment": 0.72,
"dominantEmotion": "Joy",
"frustrationPeaks": 1,
"emotionTimeline": [...]
}
}Prosody & Emotion
RealSpeak's core differentiator. Every user utterance is analyzed by Hume EVI across 48 emotional dimensions in real-time. This isn't sentiment analysis on text — it's analysis of vocal tone, pitch, cadence, and micro-expressions in speech.
48 Emotion Dimensions
Each utterance returns scores (0.0 to 1.0) for all 48 emotions. Key emotions include:
How It's Used
- Auto-escalation: When frustration exceeds a threshold, automatically transfer to a human
- Adaptive responses: Agent adjusts tone based on caller emotion
- Analytics: Track emotion trends across all calls, identify pain points
- Quality scoring: Measure how callers feel at the end vs. start of calls
Tool Calls
Tools let your agent take real actions during calls — look up orders, issue refunds, book appointments, send emails. Define tools per agent using JSON Schema parameters.
Tool Definition
{
"name": "issue_refund",
"description": "Issue a refund for a customer payment",
"parameters": {
"type": "object",
"properties": {
"payment_id": {
"type": "string",
"description": "The Stripe payment ID"
},
"amount_cents": {
"type": "number",
"description": "Refund amount in cents. Omit for full refund."
},
"reason": {
"type": "string",
"enum": ["duplicate", "fraudulent", "requested_by_customer"],
"description": "Reason for the refund"
}
},
"required": ["payment_id"]
}
}Built-in Integrations
Connect integrations from the dashboard to enable built-in tool handling — no webhook needed.
Send emails and staff notifications directly from calls
send_emailsend_notificationLook up customers, check payments, issue refunds
stripe_lookup_customerstripe_check_paymentstripe_issue_refundCheck slots, book appointments, cancel bookings
google_calendar_check_availabilitygoogle_calendar_book_appointmentgoogle_calendar_cancelTemplates
Pre-built agent configurations for common use cases. Create a fully configured agent in one API call.
List Templates
/api/v1/templatesReturns all available templates. No auth required.
Create Agent from Template
/api/v1/templatescurl -X POST https://realspeak.ai/api/v1/templates \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"templateId": "customer-support",
"agentName": "Acme Support",
"businessName": "Acme Inc"
}'Available Templates
Integrations
Connect third-party services to enable built-in tool handling. When connected, the voice proxy automatically handles matching tool calls without hitting your webhook.
List Connected Integrations
/api/v1/integrationsConnect Integration
/api/v1/integrationscurl -X POST https://realspeak.ai/api/v1/integrations \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{
"type": "stripe",
"credentials": { "api_key": "sk_live_..." }
}'Disconnect Integration
/api/v1/integrationscurl -X DELETE https://realspeak.ai/api/v1/integrations \
-H "Authorization: Bearer rs_live_sk_..." \
-H "Content-Type: application/json" \
-d '{ "type": "stripe" }'Usage & Billing
Get Usage
/api/v1/usage# Response
{
"plan": "professional",
"minutesUsed": 342,
"minutesIncluded": 1000,
"callsThisMonth": 89,
"trialEndsAt": null,
"overage": { "minutes": 0, "cost": "$0.00" }
}Pricing
Overage: $0.12/min beyond plan limits.
Error Handling
All errors return a JSON body with an error field.
{
"error": "Agent not found"
}| Status | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing API key |
| 403 | Forbidden — valid key but insufficient permissions |
| 404 | Resource not found |
| 429 | Rate limited — slow down |
| 500 | Internal error — contact support |
Rate Limits
API requests are rate limited per API key:
| Plan | Rate |
|---|---|
| Free Trial | 60 requests/min |
| Starter | 120 requests/min |
| Professional | 300 requests/min |
| Business / Enterprise | 600 requests/min |
Web Widget
Embed a voice agent directly on your website. Users can talk to your agent from the browser — no phone call needed.
Widget Config Endpoint
/api/v1/widget/config/:agentIdPublic endpoint (no auth). Returns the agent's public config for the browser widget.
Embed Code
<!-- Add to your website -->
<script src="https://realspeak.ai/widget.js"
data-agent-id="ag_abc123">
</script>
<!-- Or initialize programmatically -->
<script>
RealSpeak.init({
agentId: "ag_abc123",
position: "bottom-right", // bottom-right | bottom-left
theme: "light", // light | dark
primaryColor: "#1a1a2e",
});
</script>Need help? Email support@realspeak.ai or visit the dashboard.