How Kejue Voice works
Agents, versions, and calls — the mental model behind everything else in these docs.
Three ideas. Agents define how a conversation goes, versions make a change safe to release, and calls are the conversations themselves.
Loading diagram…
Diagram text
flowchart LR
accTitle: Agent releases and call processing
accDescr: Promote an agent draft to staging, deploy it to production, then handle calls and collect transcripts, webhooks, extractions, and analytics.
A[Agent draft] -->|promote| V[Version on staging] -->|deploy| P[Production]
P --> C[Calls: phone, web voice, chat]
C --> W[Transcripts, webhooks, extractions, analytics]Workspaces
Everything you create — agents, tools, phone numbers, calls, API keys —
belongs to one workspace. The dashboard calls it a team, and the API
calls it an org (org_id). Nothing is shared between workspaces, so use
separate ones when you need hard separation, for example between development
and production.
Two controls decide what you can do in a workspace:
- Permissions come from your role (owner, admin, builder, viewer, or a
custom role) or from your API key's scopes. Each one is a
resource:actionpair such asagents:deploy. See Roles & members. - Entitlements are features switched on for the whole workspace, such as
evals, campaigns, flows, groups, guardrails, and alerts. A missing one
returns
403 entitlement_requiredwhatever your role.
Agents
An agent is the thing that talks. Its prompt says who it is and what the call is for. Around the prompt sit its models and voice, turn-taking, tools for calling your systems, guardrails that check what it says, and transfers to people. The agents section covers each one.
Agents can work together. A flow (beta) hands a live call from one agent to another when the caller's need changes, and keeps one call and one transcript. A group splits live traffic across agents so you can compare them.
Versions: draft, staging, production
Editing an agent edits its draft. Nothing live changes until you promote the draft to a numbered version, then deploy that version.
- Promote freezes the draft into a numbered version that can't change and points staging at it.
- Deploy points production at the staging version.
Every call runs the version that was deployed when it started, so a mid-call edit never changes a conversation in progress. To roll back, deploy an older version. Point staging at the older version before deploying it. Promote and deploy are separate permissions, so one person can build while another approves go-live.
Calls
A call is one conversation. It arrives three ways, all running the same agent, tools, and guardrails:
| Channel | How it connects | Who starts it |
|---|---|---|
| Phone | Your SIP trunk or Twilio account and a phone number | A caller dials in, or we dial out from an outbound job or a campaign (beta) |
| Web voice | WebRTC in the browser | Your backend requests credentials with POST /web-calls |
| Text chat (beta) | The same browser SDK with modality: "text" | The same credential request |
The agent listens, thinks, and speaks in turns. Transfers, keypad input, and hanging up are settings, not code you host — the one thing you host is your own tool endpoints.
How the agent hears and speaks
You choose one of two pipelines for each agent:
- Speech model — one model hears the caller's audio and replies in speech. Turn-taking feels most natural. New agents start here.
- Cascaded — speech-to-text, a text model, then text-to-speech. Pick each part separately from the catalog.
Either way, turn-taking decides when the caller has finished speaking. When guardrails are on, they sit between the model and the caller: speech that fails a check is never played, and if a check can't run we fail closed.
After the call
When a conversation ends, we:
- Store the call with a PII-redacted transcript. Reading the raw transcript is a separate, audited request — see Compliance.
- Run the agent's after-call work: a summary and structured extractions, such as a claim type or a callback date.
- Send a signed
call.completedwebhook with the transcript, outcome, and extracted data. - Update analytics boards and usage.
Testing
Evals play simulated callers against a draft or a staged version and grade the result with checks you define. Run them before every release, and point them at real production calls to catch drift.
Where the API fits
Everything on this page is a resource under https://api.kejue.co/v1, and
the dashboard uses the same rules. Conventions shared by every endpoint —
authentication, errors, retries, pagination — are in
API essentials.