PyAI Voice AI

v0.5.30
io.github.atomsai/pyai Checked 9 hours ago Published 3 days ago

Speech, transcription, voice agents, Trace, Recap, dubbing and narration with browser OAuth.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

openapi_get Openapi Get

Fetch live API operation discovery with a SHA-256 digest. Supply path and method for one operation and its referenced schemas, or include_document=true for the entire contract. Pin sha256 to detect contract drift. No API key required.

ParameterTypeDescription
include_documentboolean
methodstring
pathstring
sha256string

create_sandbox_key Create Sandbox Key

Create a NEW isolated sandbox only when the user asks to try PyAI without an account. Local stdio only. Adopts the key privately for this session; never returns the secret. Prefer pyai login to use an existing workspace.

ParameterTypeDescription
labelstringOptional label (e.g. your app name) shown in the PyAI console.

get_started Get Started

Return a concise, correct quickstart for building with PyAI (auth, SDK install, TTS/STT/realtime snippets, error handling). No key or network needed, read this before writing PyAI code so you use the right endpoints and the official SDK.

whoami Who Am I

Introspect the active key (GET /v1/me): org, environment (test/live), granted scopes, and rate-limit/credit posture. Organization and project names and IDs, billing guidance, and any managed payer/budget appear in text and structuredContent. Names are display labels; verify IDs and environment too. Use verbose=true for key identity details. Use it before usage and to diagnose a 401/403/402.

ParameterTypeDescription
verbosebooleanInclude authorized identity details in text. Credentials are always omitted.

list_models List Models

List the available PyAI models (catalog). No arguments.

list_voices List Voices

Browse stock and saved designed voices. Filter stock voices by spoken language, accent/locale, gender or product. Prefer a locale for a regional accent. If no matching voice is listed, explain the gap before offering alternatives.

ParameterTypeDescription
genderstringFilter by voice gender (e.g. female, male).
languagestringSpoken language code, e.g. en, es or fr. Combine with region for an accent.
productstringUse speak for prerecorded speech and omni for a live voice agent.
regionstringRequested accent or locale, e.g. en-US, en-GB, en-AU, es-MX or fr-CA. Use the requested locale even if availability is unknown.

synthesize_speech Synthesize Speech

Generate speech from input. Consumes usage in the connected project; live usage can be billed. Before generation, use whoami to verify project, environment, scopes, credit and limits. Local stdio returns inline audio, or output_path and bytes when a path is supplied. For integration code only, use get_started without generating audio.

ParameterTypeDescription
input *stringText to synthesize. Maximum 2000 characters; longer text answers `400 input_too_long` naming the limit and the length you sent. Split longer scripts into several requests.
modelstringDefaults to pyai-speak.
output_pathstringAbsolute file path to write the audio to.
response_formatstringDefaults to mp3.
voicestringVoice id from list_voices. Omit for the account default.

create_transcription_job Create Transcription Job

Submit an async speech-to-text job for an audio URL (https). Returns a job_id; poll with get_transcription_job. Supports diarization.

ParameterTypeDescription
audio_url *stringhttps URL of the audio to transcribe.
call_directionstring
call_idstringStable id for the post-call Recap. Defaults to the job id.
channelbooleanDual-channel (stereo) per-channel speakers.
customer_namestring
diarizebooleanSingle-track speaker diarization.
modelstring
output_formatsarrayDefaults to [json].
pack_idstringOptional Recap pack (default sales_outbound).
transcription_languagestringSpoken-language hint applied to every channel, chunk and speech span. Omit for automatic detection. Independent of the Recap summary language.

get_transcription_job Get Transcription Job

Get the status + result of a transcription job by id.

ParameterTypeDescription
job_id *stringThe job_id from create_transcription_job.

configure_amd Configure AMD

Set the PyAI AMD (answering-machine detection) operating point + webhook (POST /v1/amd/config). `aggressiveness` is one dial 0-1: near 0 is human-safe (never hang up on a person), near 1 fires 'machine' fast. The realtime detection itself is a Twilio Media Streams WebSocket (wss /v1/amd/stream), a one-line-TwiML drop-in, not an MCP tool.

ParameterTypeDescription
aggressivenessnumberOperating point 0-1 (default 0.25).
webhook_urlstringhttps URL to POST amd.call.completed events to.

list_amd_calls List AMD Calls

List recent PyAI AMD decisions (GET /v1/amd/calls). Each carries answered_by (human/voicemail/ivr/screening/sit_invalid/…), answered_by_twilio (Twilio's enum, for routing parity), confidence, decision_ms, and the word-level reason.

ParameterTypeDescription
limitnumberMax results (1-100, default 20).
session_labelstringFilter by the opaque connect-URL/TwiML tag.

get_amd_call Get AMD Call

Get one PyAI AMD decision by call id (GET /v1/amd/calls/{id}): who/what answered, with the reason.

ParameterTypeDescription
call_id *stringThe call id the decision was recorded under.

enable_recap Enable Recap

Enable Recap for the key's org (PUT /v1/recap/config). Sandbox keys already mint with Recap on; call this to set a webhook or pack, or to enable Recap on a signup/live key. Requires recap:configure.

ParameterTypeDescription
default_pack_idstringDefaults to sales_outbound.
enabledbooleanDefaults to true.
webhook_urlstringhttps URL for recap.complete events.

create_recap Create Recap

Submit speaker-labelled utterances and get a recap.call (POST /v1/recap/calls/{call_id}). Requires recap:create and Recap enabled. To poll with get_recap, also request recap:lookup.

ParameterTypeDescription
call_id *stringStable id you will read back.
utterances *array
call_directionstring
customer_namestring
pack_idstring

get_recap Get Recap

Read one Recap by call id (GET /v1/recap/calls/{call_id}). When complete, `record` is recap.record.v1 (tldr, summary, action_items, disposition, next_steps, talk_ratio, signals, fields). Requires recap:lookup and Recap enabled.

ParameterTypeDescription
call_id *stringThe call_id passed to create_recap or the Hear job.

list_recap_calls List Recap Calls

List existing Recap records for the organization (GET /v1/recap/calls). Requires recap:lookup and Recap enabled.

ParameterTypeDescription
limitnumberMax results (1-100, default 20).
statusstring

omni_list_calls Omni List Calls

List Omni sessions, including inbound calls. Filter by session_label and preserve each returned call_id.

ParameterTypeDescription
cursorstringPass the previous page's `next_cursor`.
limitinteger
session_labelstringOnly calls connected with this opaque session tag.

omni_get_call Omni Get Call

Read an Omni session's transcript, recording availability and summary. For outbound calls use artifacts.omni_call_id from calls_get.

ParameterTypeDescription
call_id *stringStable opaque PyAI-owned call identifier. Use it unchanged across every Omni call sub-resource.

omni_get_summary Omni Get Summary

Read the structured summary for an Omni call when generated; a missing summary is not an empty result.

ParameterTypeDescription
call_id *stringStable opaque PyAI-owned call identifier. Use it unchanged across every Omni call sub-resource.

omni_get_transcript Omni Get Transcript

Read the complete Omni call transcript through the authenticated API.

ParameterTypeDescription
call_id *stringStable opaque PyAI-owned call identifier. Use it unchanged across every Omni call sub-resource.

omni_get_recording Omni Get Recording

Get the canonical authenticated recording resource URL. Requires response=url. This URL is not public playable audio; recording must have been enabled.

ParameterTypeDescription
call_id *stringStable opaque PyAI-owned call identifier. Use it unchanged across every Omni call sub-resource.
response *stringSet to `url` to return the canonical authenticated PyAI recording resource as JSON.

telephony_search_numbers Telephony Search Numbers

Search available managed numbers and inspect provisioning requirements before purchase.

ParameterTypeDescription
area_codestring3-digit US or Canada area code (NPA).
containsstringDigit pattern the number should contain.
countrystringISO-2 country to search in.
limitinteger

telephony_list_numbers Telephony List Numbers

List owned numbers and current Agent bindings before changing inbound routing.

ParameterTypeDescription
include_releasedboolean

telephony_buy_number Telephony Buy Number

Purchase a managed number. Requires explicit user approval (confirm=true) and a stable idempotency_key. May incur recurring charges; regulatory or billing setup may require Console.

ParameterTypeDescription
body *object
idempotency_key *stringRequired safe retry key. Reusing the key with an identical body preserves the saved order outcome (201 confirmed number, 202 pending/unknown US, Canadian or Australian order, or 200 definitively faile…
confirmbooleanSet true only after the user authorizes this exact purchase or destination.

telephony_bind_number Telephony Bind Number

Bind an owned number to an Agent using body.agent_id; null unassigns. Read existing bindings first. Changes inbound routing.

ParameterTypeDescription
body *object
id *string

telephony_create_call Telephony Create Call

Place a real outbound call only to a user-authorized destination. Requires confirm=true and a stable idempotency_key. This is not a sandbox simulation. Preserve the returned ID; never redial after an uncertain timeout.

ParameterTypeDescription
body *object
idempotency_key *stringRequired safe-retry key. Identical retries return the original call; a different body returns 409.
confirmbooleanSet true only after the user authorizes this exact purchase or destination.

calls_list Calls List

List outbound calls and normalized network outcomes before retrying a dispatch.

ParameterTypeDescription
cursorstringLast call id from the previous page. Tenant and project scoped.
directionstring
limitinteger
statusstring

calls_get Calls Get

Read the current state of an outbound call by returned ID. dispatch_unknown needs inspection, not another call. Recap and Omni recordings are separate resources.

ParameterTypeDescription
id *string

list_agents List Agents

List saved voice Agent profiles before creating or changing one.

create_agent Create Agent

Create a reusable voice Agent profile: persona, greeting, voice, language, tools and knowledge. Does not place a call.

get_agent Get Agent

Read a saved voice Agent profile and its current configuration.

ParameterTypeDescription
id *stringAgent id, e.g. `agent_7f3a…`.

update_agent Update Agent

Update a voice Agent profile. Read it first and change only user-requested fields.

set_agent_tools Set Agent Tools

Replace the tools bound to an Agent. Read the current Agent first; this replaces its bindings.

ParameterTypeDescription
body *array
id *string

set_agent_knowledge Set Agent Knowledge

Replace the knowledge bases bound to an Agent. Read its existing bindings first.

ParameterTypeDescription
body *array
id *string

list_published_website_widgets List Published Website Widgets

Look up published managed website voice widgets in the connected project without an agent ID. Read their public embed snippets, exact origins and effective daily session limits. Follow next_cursor while has_more before concluding no match. Ask which widget if multiple match. This read does not create a widget or start a session.

ParameterTypeDescription
cursorstringPass next_cursor from the previous page.
limitinteger

draft_website_widget Draft Website Widget

Save an unpublished website voice widget for a saved agent in the connected project. Specify the exact HTTPS origin and both daily session limits. The hosted widget sends visitor microphone audio to PyAI. Its session quotas cannot enforce a hard total spending cap. To replace a draft, first preview it and pass its expected_revision. A published widget cannot be edited here.

ParameterTypeDescription
body *object
id *stringSaved agent ID in the authenticated project.

preview_website_widget Preview Website Widget

Read the saved managed website voice widget for this agent. Show its project, exact origins, session limits, status, embed snippet, readiness and revision before asking to publish. Does not publish or start a session.

ParameterTypeDescription
id *stringSaved agent ID in the authenticated project.

publish_website_widget Publish Website Widget

Publish the managed website voice widget only after the user explicitly approves the displayed project, origins, limits and embed for that exact preview revision. Set body.approved=true and pass body.revision. Return the snippet verbatim. The hosted widget sends visitor microphone audio to PyAI. Sessions may consume project credit and session quotas cannot enforce a hard total spending cap. After an uncertain result, preview the widget before any further action.

ParameterTypeDescription
body *object
id *stringSaved agent ID in the authenticated project.

get_trace_config Get Trace Config

Inspect Trace call-compliance configuration.

ParameterTypeDescription
agent_idstringAgent to read config for; omit for the org default.

configure_trace Configure Trace

Configure Trace compliance monitoring for the selected workspace.

ParameterTypeDescription
body *objectPer-agent Trace config (spec §5.1). May be wrapped as { agent_id, config } or sent raw.

list_trace_rule_packs List Trace Rule Packs

Discover available Trace compliance rule packs before enabling monitoring.

create_trace_rule_pack Create Trace Rule Pack

Create a workspace Trace compliance rule pack. This creates persistent configuration.

ParameterTypeDescription
body *objectAn authored rule pack in the Trace DSL (rule_pack_schema.json).

list_trace_interactions List Trace Interactions

Find monitored calls and interactions for compliance review.

ParameterTypeDescription
agent_idstring
cursorstring
limitinteger
verdictstring

get_trace_interaction Get Trace Interaction

Read one monitored interaction and its compliance evidence.

ParameterTypeDescription
id *stringThe call_id.

list_trace_findings List Trace Findings

Find compliance findings with source evidence. Findings are signals for review, not legal conclusions.

ParameterTypeDescription
actionstring
check_idstring
cursorstring
interaction_idstring
limitinteger
severitystring

list_trace_violations List Trace Violations

List Trace rule violations for compliance review.

ParameterTypeDescription
cursorstring
interaction_idstring
limitinteger
rule_idstring
severitystring

get_trace_exposure Get Trace Exposure

Read aggregate compliance exposure for the workspace.

ParameterTypeDescription
window_daysintegerTrailing window in days.

get_recap_config Get Recap Config

Read Recap summarization configuration before changing it.

get_cast_capabilities Get Cast Capabilities

Discover Cast voices, emotions, formats and supported rendering capabilities.

direct_cast_script Direct Cast Script

Turn a narration script into directed Cast lines before rendering. Consumes usage.

ParameterTypeDescription
body *object

render_cast Render Cast

Submit script text or directed lines using one top-level voice from get_cast_capabilities for the entire render. Per-line voices and a console project are not required or supported inputs. Returns a job; preserve its ID, poll get_cast_render and retrieve get_cast_audio when done. Consumes usage; do not resubmit on timeout.

ParameterTypeDescription
body *object

list_transcription_jobs List Transcription Jobs

Find existing audio processing and transcription jobs before submitting duplicates.

ParameterTypeDescription
cursorstringOpaque token from a previous page's `next_cursor`. Omit for the first page.
limitintegerMax items to return (1-100).

discover_tools Discover Tools

Find the right PyAI tools and a short recipe for speech, STT, LiveKit or Pipecat integration, voice agents, compliance, summaries, dubbing or narration. No credentials or usage.

ParameterTypeDescription
querystringProduct, framework or task, e.g. “LiveKit”, “Pipecat integration”, “translate audio”, “voice agent”, “TTS”.
taskstringAlias for query. If both are supplied, they must match after trimming.

get_dub_capabilities Get Dub Capabilities

Read currently supported Dub input and output languages before submitting a translation.

create_dub Create Dub

Fetch audio from the user-authorized HTTPS source URL and start a translation and dubbing job. Accesses an external source and consumes usage. Keep job_id and poll get_dub_job; do not submit again after a timeout.

ParameterTypeDescription
source_lang *stringSource language from get_dub_capabilities.
source_url *string
target_lang *stringTarget language from get_dub_capabilities.

get_dub_job Get dubbing job status

Retrieve the status and available results of an existing dubbing job by job_id. This read does not start or repeat a job. Poll pending/processing states without resubmitting.

ParameterTypeDescription
job_id *stringThe ID returned by the original submission; do not invent one.

get_dub_audio Get Dub Audio

Retrieve completed dubbed audio as a playable result or download. Call only when get_dub_job reports done.

ParameterTypeDescription
job_id *stringThe ID returned by the original submission; do not invent one.

get_cast_render Get Cast Render

Check a durable Cast render job. Preserve the original job ID.

ParameterTypeDescription
job_id *stringThe ID returned by the original submission; do not invent one.

get_cast_audio Get Cast Audio

Retrieve completed Cast narration as playable audio or a download.

ParameterTypeDescription
job_id *stringThe ID returned by the original submission; do not invent one.

preview_cast_line Preview Cast Line

Generate one directed Cast line. Consumes usage. Check get_cast_capabilities for supported voice, emotion and intensity.

ParameterTypeDescription
emotion *stringSupported emotion.
intensity *Use a tier from Cast capabilities: subtle, balanced or bold; or a number from 0 to 1. Legacy low/med/high aliases are normalized by MCP.
text *stringNarration text.
voice *stringA supported Cast voice.

transcribe_audio Transcribe Audio

Transcribe a small audio attachment supplied as base64 (up to 8 MiB decoded). Returns the synchronous transcript without diarization controls. For word timestamps and speaker labels, use create_transcription_job with diarize=true for mono or channel=true for stereo, then get_transcription_job. Consumes usage.

ParameterTypeDescription
audio_base64 *stringBase64-encoded audio bytes, without a data: prefix.
filename *string
languagestring