https://api.pyai.com/v1.
HTTP auth accepts either 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.
Get a key
Sign up at console.pyai.com, click Create API
key, and copy it (shown once). Use a
pyai_test_ sandbox key to start —
it works instantly with hard daily caps and no billing.Verify it in 5 seconds
GET /v1/me needs no special scope, so it’s the fastest possible first call —
and it’s self-diagnosing: it echoes back the org, environment, granted scopes,
and credit posture the gateway resolved for your key.200 means your key is live everywhere. A 401 means the key is wrong; a
402 is the billing gate (use a pyai_test_ key) — never a broken key.List voices
id as the voice above, or create your own with voice
cloning (/v1/voice/clones). 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.Talk to a realtime 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 — just open a
WebSocket and pass the key as a subprotocol (browser-safe). One
configure
frame sets the whole agent for the session: 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 is an optional opaque tag echoed to your kb_endpoint.Next steps
Build a browser voice agent
Mic → Omni → speakers in ~10 minutes, all client-side.
Omni tools & function calling
Give your agent real actions: order lookups, bookings, transfers.
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.