https://api.pyai.com/v1.
For a saved agent you can manage in both the UI and code, start with
Build and run Agents or
Create agents via API. The direct Omni examples below
remain useful when you want inline session configuration without a saved profile.
Step 1, get a key
Fastest: an instant sandbox key, no signup, email, or card. It works immediately, skips the credit gate, and is bounded by daily caps:GET /v1/me echoes the org, scopes, and credit posture
your key resolves to):
scopes before you call a
product. A sandbox mint includes Hear, Speak, Clone, Omni, Cast, AMD, Dub,
Recap, and Trace. It does not include voice design or hosted
knowledge-base management.
pyai_live_ key in the console. Live usage is billed against
prepaid credit; see the pricing page for current
terms. HTTP auth accepts Authorization: Bearer <key> or the header
alias x-api-key: <key>.
Fastest start: scaffold a complete, runnable example in one command, no
clone, no setup ceremony.Browse them all at github.com/atomsai/pyai-examples.
Step 2, pick what you’re building
Not sure which surface? Start at Choose your path.AI voice agent (Omni)
Replace the speech-to-text, LLM, text-to-speech, VAD, and turn-detection cascade with one WebSocket.
Speech To Text (Hear)
Choose one-file, live-streaming, or timestamped async transcription.
Text To Speech (Speak)
Choose a voice, delivery mode, output format, and sample rate.
Clone a voice
Enroll a consented voice from a short clip and use it on Speak or Omni.
Expressive voice (Cast)
Direct, preview, and render expressive multi-line speech.
Answering-machine detection (AMD)
Know who or what answered, human, voicemail, IVR, screening, with the reason. Twilio drop-in.
Call summaries and actions (Recap)
Turn completed transcripts into notes, action items, talk ratio, signals, and fields.
Compliance guardrails (Trace)
Rule packs (TCPA, HIPAA, PII) and scorecards for eligible calls.
No code: Agents Live Beta
Configure, test, and connect an Omni voice agent from the console.
AI voice agent (Omni)
Omni is the complete voice agent behind one realtime endpoint. It hears, reasons, calls tools, grounds answers in your knowledge, and speaks back. Your app streams audio to one WebSocket instead of operating separate speech-to-text, LLM, text-to-speech, VAD, turn-detection, and interruption components. Connect and confirm that your key can configure a session:Speech-to-text (Hear)
One POST transcribes a file:Text-to-speech (Speak)
voice is a stock voice id from GET /v1/voices (the curated prebuilt catalog
with personas and avatars) or a cloned voice id from
Clone. Omit it and Speak uses the default stock voice,
stock_dorit_en_us. Send voice explicitly in production code so a change to
the default can never change how your app sounds.
pyai-speak is the canonical model. OpenAI’s tts-1 and tts-1-hd model names
remain accepted for compatibility. The preset names alloy, echo, fable,
onyx, nova, and shimmer also remain drop-in aliases for PyAI stock voices.
See the Speak guide for the voice catalog, streaming
vs buffered delivery, output formats, sample rates, and telephony.
Clone a voice
Enroll a consented English reference clip, poll untilstatus is ready, then
pass the returned voice_id to Speak or Omni:
GET /v1/voice/clones (or
pyai.clones.get in the SDK, which filters that list) until status is
ready or failed. Then pass that id as voice on Speak or Omni. If the
first render answers 409 voice_propagating, wait the Retry-After seconds
and send the same request again — do not re-enroll.
Clone requires the speak:clone scope. Signup keys and sandbox mint keys both
include it. The Clone guide covers clip quality,
polling, Omni use, and why a clip gets rejected.
Expressive voice rendering (Cast)
Cast lives only under/v1/cast/* and requires cast:render. Preview one line
without a console project:
422 unsupported_voice. Refresh GET /v1/cast/capabilities and pick an id
from voices[]. The Cast guide covers direction,
capabilities, and long-form render jobs.
Answering-machine detection (AMD)
Already on Twilio? Point a Media Stream atwss://api.pyai.com/v1/amd/stream
and get answered_by (human, voicemail, ivr, screening, …) plus the
reason it decided, in a fraction of the dead-air dwell. Set the
operating-point dial and webhook once:
Compliance guardrails (Trace)
Trace scans eligible calls against built-in rule packs (TCPA, HIPAA, PII, brand-voice) and your own rules, then gives each scanned call a scorecard with plain-English findings. Turn it on for your org (or one agent) with one PUT:warn logs only (never blocks), modify redacts PII / injects
disclosures, block suppresses, human_handoff escalates. Always fail-open.
Then read your exposure dashboard and per-call evidence:
trace:configure / trace:read scopes. It’s in
beta and must be enabled for your organization. Your console shows current
terms and any promotional treatment; see the
pricing page. Full walkthrough:
Trace guide.
Call summaries and actions (Recap)
Sandbox keys include Recap scopes and mint with Recap enabled. Submit speaker-labelled utterances, then read the typed record:POST returns 202 with status: "pending". Poll GET until status is
complete. A finished record looks like this:
Next steps
Use-case build guides
Build your own Gong, a voice dictation app, an AI receptionist, or call-center QA, step by step.
Build a browser voice agent
Mic → Omni → speakers in ~10 minutes, all client-side.
Agent greeting messages
Set an opening line on an agent profile in the console, spoken at turn 0.
Omni tools & function calling
Give your agent real actions: order lookups, bookings, transfers.
AMD guide
Twilio Media Streams drop-in, tuning, and webhooks.
SDKs
Official Python and TypeScript clients, plus LiveKit and Pipecat.
Authentication
Keys, environments, rotation, revocation.
Production readiness
Regions, languages, live-key billing, reconnect behavior, limits, and retention.
Pricing
Current rates, included usage, and plan availability.
Errors & limits
Error codes, rate limits, idempotency.
API reference
Full request/response schemas, right here in the docs.
Runnable examples
Copy-paste apps, OpenAI drop-in, voice cloning, telephony, call analytics.
npm create pyai-app@latest.