Speko Docs

voice

Outbound phone calls through POST /v1/sessions/phone.

Use speko.voice.dial() to place an outbound PSTN call. The API creates a voice session, dispatches the configured worker, and dials the destination over LiveKit SIP.

const call = await speko.voice.dial({
  to: '+12015551234',
  from: '+12015550199',
  agentId: 'agent_123',
  telephony: {
    region: 'us-east',
    amd: { mode: 'agent', timeoutSeconds: 8 },
  },
});

console.log(call.sessionId, call.status);

Signature

speko.voice.dial(params: VoiceDialParams): Promise<VoiceDialResult>

Parameters

FieldTypeDescription
tostringDestination in E.164 format.
fromstring?Caller ID. Must be registered to the organization unless it is the server default.
agentIdstring?Persisted agent to run. Required unless intent is supplied.
intentRoutingIntent?Routing intent for ad hoc calls. Required unless agentId is supplied.
constraintsPipelineConstraints?Provider allow-list constraints.
voicestring?TTS voice id override.
systemPromptstring?Agent instructions for this call.
firstMessagestring?Optional first utterance.
llm{ temperature?: number; maxTokens?: number }?LLM tuning.
ttsOptions{ sampleRate?: number; speed?: number }?TTS options.
sttOptions{ keywords?: string[] }?STT keyword hints.
telephony{ region?: string; amd?: { mode?: 'agent' | 'carrier' | 'disabled'; timeoutSeconds?: number } }?SIP routing and voicemail-detection hints.
metadataRecord<string, unknown>?Free-form metadata surfaced in webhooks and call events.

Returns

FieldTypeDescription
sessionIdstringVoice session id.
callControlIdstringLiveKit SIP participant identity for the outbound leg.
roomNamestringLiveKit room name.
status'dialing' | 'dialing-stub'Dial status. Stub appears when SIP is not configured in the deployment.
tostringDestination number.
fromstringResolved caller ID.

On this page