Implementation guide

Build an enterprise voice agent.

Map business design work to StateSet Voice API objects, runtime configuration, observability, and rollout controls.

Design the agent contract

Inputs

Caller identity, route, language, intent, consent state, account context, and current task.

Allowed actions

Lookups, SMS, scheduling, escalation, callback creation, evaluation, or no-op.

Exit rules

Escalate or stop when policy, authentication, payment, safety, or confidence limits are reached.

Intent catalog

Define what the agent can resolve

List allowed intents, triage-only intents, and requests that must transfer to a human operator.

Tool boundary

Keep action scope explicit

Map each intent to the smallest allowed tool set: lookup, SMS, scheduling, escalation, callback, or evaluation.

Configure tenant and agent runtime

curl -sS -X PUT "https://voice.stateset.app/api/v1/admin/tenants/{tenant_id}/runtime-config" \
  -H "x-admin-key: ${STATESET_ADMIN_API_KEY}" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-realtime",
    "voice": "alloy",
    "system_prompt_key": "support_default"
  }'

Connect telephony and tools

For outbound traffic, call /api/v1/make-call. For inbound traffic, configure Twilio to POST to /api/v1/incoming-call. The runtime manages media streaming, tool execution, and session state.

Observe and evaluate

Use call logs, voice sessions, active sessions, evaluation endpoints, and callback queues to understand outcomes and improve prompts, tools, and handoff rules.

SignalWhat it answersOperational use
Call logWhat happened during the phone call?Support audit, callback reconciliation, and status tracking.
Voice sessionWhat did the agent hear, say, and do?Transcript review, tool-call debugging, and prompt iteration.
EvaluationWas the conversation high quality?Launch gates, regression checks, and rollout policy.
Callback taskWhat work still needs a human?Queue ownership, SLA tracking, and follow-up notifications.

Launch with governance

  • Run synthetic calls for every supported intent and escalation path.
  • Confirm Twilio signature verification and short-lived media stream tokens.
  • Verify call logs, session records, callback queues, and live log streaming.
  • Stage traffic with agent versions and rollout policy before routing all calls.