Skip to main content
PyAI is telephony-native Voice AI behind one API key: Omni, the all-in-one voice agent model (hearing, reasoning, tool calling, and emotion-aware speech over one WebSocket), Hear (speech-to-text), Speak (text-to-speech + cloning), Cue (turn detection + knowledge-base context for your own pipeline), the AMD API (answering-machine detection), and Trace (compliance guardrails). The API is OpenAI-compatible at https://api.pyai.com/v1.

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:
Verify it in 5 seconds (GET /v1/me echoes the org, scopes, and credit posture your key resolves to):
For production: create an account and mint a pyai_live_ key in the console. Live usage is billed against prepaid credit. 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

AI voice agent (Omni)

One WebSocket: the agent hears, reasons, calls your tools, and speaks back. Nothing to create first.

Speech-to-text (Hear)

Transcribe a file with one POST, or stream partials over WebSocket.

Text-to-speech (Speak)

Turn text into natural speech with stock, cloned, or designed voices.

Answering-machine detection (AMD)

Know who or what answered, human, voicemail, IVR, screening, with the reason. Twilio drop-in.

Compliance guardrails (Trace)

Rule packs (TCPA, HIPAA, PII) and per-call scorecards for your agents.

No code: Agents Beta

Configure, test, and connect an Omni voice agent from the console.

AI voice agent (Omni)

Omni is the whole voice agent in one model, it hears, reasons with a fused LLM brain, calls your tools, grounds answers in your knowledge base, and speaks back in emotion-aware voices. It’s zero-state: the session is authorized by your key’s org, so there’s nothing to create first. Open a WebSocket, pass the key as a subprotocol (browser-safe), and send the whole agent in one configure frame: voice_id, persona, kb_endpoint (grounding), and tools[] (function calling). Enable prebuilt hosted tools by name with zero setup, search_knowledge, web_search, weather, currency, unit_convert, math, datetime, geocode, news, or register your own webhook (Omni tools).
session_label on the connect URL is an optional opaque tag echoed to your own kb_endpoint so you can branch per session. When it equals a /v1/agents profile id, the engine loads persona, voice, and greeting from that profile. Rather not host a knowledge endpoint? Create a hosted knowledge base and bind it to the agent (/v1/knowledgebases), and Omni retrieves from it per turn, nothing for you to run. Full frame catalog: the Omni wire protocol.

Speech-to-text (Hear)

One POST transcribes a file:
Need live partials (voice bots, captions, agent assist)? Stream over WebSocket instead, first partial typically lands within ~300 ms: streaming STT guide. For large backlogs, the async batch API (POST /v1/transcription/jobs) is discounted vs. realtime.

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 /v1/voice/clones. Omit it to use your account’s default voice. Migrating from OpenAI? The preset names alloy, echo, fable, onyx, nova, and shimmer work as drop-in aliases for PyAI stock voices, so existing code runs unchanged.

Answering-machine detection (AMD)

Already on Twilio? Point a Media Stream at wss://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:
AMD needs a key with the amd:detect / amd:configure scopes (add scopes in the console), and bills per answered call, the first 5,000 each month are free. Full walkthrough: AMD guide.

Compliance guardrails (Trace)

Trace scans every agent call against built-in rule packs (TCPA, HIPAA, PII, brand-voice) and your own rules, then gives each call a scorecard with plain-English findings. Turn it on for your org (or one agent) with one PUT:
Modes: 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 needs a key with the trace:configure / trace:read scopes. It’s in beta, free during beta, and defaults to on in warn mode. Full walkthrough: Trace guide.
Prefer the official SDKs, they handle auth, retries, idempotency, and realtime for you: npm install @pyai/sdk or pip install pyai-sdk.

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.

Authentication

Keys, environments, rotation, revocation.

Pricing & metering

How usage is measured and billed.

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.