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

GET/api/v1/agents
curl 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

POST/api/v1/agents
ParameterTypeDescription
name*stringAgent display name
systemPrompt*stringInstructions defining agent behavior
llmModelstringLLM model ID. Default: claude-sonnet-4-5-20250514
voiceNamestringHume voice name (e.g. Ito, Kora, Serene Assistant). See GET /voices for full catalog. Default: Ito
firstMessagestringGreeting spoken when a call starts
webhookUrlstringURL to receive call events (HMAC-SHA256 signed)
webhookSecretstringSecret for HMAC signature verification
backgroundNoisestringAmbient audio: none, call_center, office, cafe. Default: call_center
maxCallDurationSecondsintegerMax call length in seconds. Default: 1800 (30 min)
deadAirTimeoutSecondsintegerSilence timeout. Default: 45
interruptionSensitivityfloat0.0 (never interrupt) to 1.0 (very sensitive). Default: 0.5
recordingEnabledbooleanRecord calls via Telnyx. Default: false
toolsarrayTool 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

PATCH/api/v1/agents/:id

Accepts 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

DELETE/api/v1/agents/:id

Permanently 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.

ParameterTypeDescription
allowHangupbooleanWhether the agent can hang up calls. Default: true
transferEnabledbooleanEnable call transfer capability
transferTypestringwarm, cold, or agent. Default: warm
transferDestinationstringPhone number or agent ID for transfers
transferMessagestringMessage spoken before transfer
humanEscalationEnabledbooleanAuto-escalate to human on frustration
humanEscalationNumberstringPhone number for human escalation
humanEscalationThresholdfloatFrustration 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

GET/api/v1/calls
ParameterTypeDescription
agentIdstringFilter by agent
limitintegerResults per page (max 100). Default: 50
offsetintegerPagination 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

GET/api/v1/calls/:id

Returns 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

GET/api/v1/numbers/search
ParameterTypeDescription
area_codestring3-digit area code (e.g. 415)
citystringCity name
statestring2-letter state code

Purchase Number

POST/api/v1/numbers/purchase
curl -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

PATCH/api/v1/numbers/:id
curl -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

DELETE/api/v1/numbers/:id

Removes 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:

AdmirationAdorationAmusementAngerAnxietyAweAwkwardnessBoredomCalmnessConcentrationConfusionContemptContentmentCravingDesireDeterminationDisappointmentDisgustDistressDoubtEcstasyEmbarrassmentEmpathic PainEntrancementEnvyExcitementFearGratitudeGuiltHorrorInterestJoyLoveNostalgiaPainPrideRealizationReliefRomanceSadnessSatisfactionShameSurprise (negative)Surprise (positive)SympathyTirednessTriumphFrustration

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.

Email (Mailgun)

Send emails and staff notifications directly from calls

send_emailsend_notification
Stripe

Look up customers, check payments, issue refunds

stripe_lookup_customerstripe_check_paymentstripe_issue_refund
Google Calendar

Check slots, book appointments, cancel bookings

google_calendar_check_availabilitygoogle_calendar_book_appointmentgoogle_calendar_cancel

Templates

Pre-built agent configurations for common use cases. Create a fully configured agent in one API call.

List Templates

GET/api/v1/templates

Returns all available templates. No auth required.

Create Agent from Template

POST/api/v1/templates
curl -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

Customer SupportComplaints, FAQs, feedback, escalation
2 tools
E-CommerceOrders, returns, refunds, product questions
3 tools
HealthcareAppointments, prescription refills, patient intake
3 tools
Home ServicesBooking, emergency dispatch, quotes
3 tools
Professional ServicesClient intake, scheduling, document requests
3 tools

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

GET/api/v1/integrations

Connect Integration

POST/api/v1/integrations
curl -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

DELETE/api/v1/integrations
curl -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

GET/api/v1/usage
# Response
{
  "plan": "professional",
  "minutesUsed": 342,
  "minutesIncluded": 1000,
  "callsThisMonth": 89,
  "trialEndsAt": null,
  "overage": { "minutes": 0, "cost": "$0.00" }
}

Pricing

Free Trial
$0
50 min1 agent • 14 days
Starter
$99/mo
200 min1 agent
Professional
$299/mo
1,000 min5 agents
Business
$599/mo
3,000 min15 agents

Overage: $0.12/min beyond plan limits.

Error Handling

All errors return a JSON body with an error field.

{
  "error": "Agent not found"
}
StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
403Forbidden — valid key but insufficient permissions
404Resource not found
429Rate limited — slow down
500Internal error — contact support

Rate Limits

API requests are rate limited per API key:

PlanRate
Free Trial60 requests/min
Starter120 requests/min
Professional300 requests/min
Business / Enterprise600 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

GET/api/v1/widget/config/:agentId

Public 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.