Pipeline
What an agent hears, decides and speaks with, read as three stages and what they cost.
The org's own key, holding pipeline. These endpoints belong to the agent: a tenant's own dashboard
opens them as readily as the console does.
GET /v1/agents/{slug}/pipeline#
What one agent would hear, decide and speak with on its next call, and how fast its last calls were.
{ "agent": "clinica-norte",
"hears": { "vendor": "soniox", "model": null, "voice_id": null, "language": "es", "languages": ["es", "en"] },
"decides": { "vendor": "anthropic", "model": "claude-haiku-5-5", "voice_id": null, "language": null, "languages": [] },
"speaks": { "vendor": "elevenlabs", "model": null, "voice_id": "a-voice", "language": "es", "languages": ["es", "en"] },
"talks": null,
"greeting": { "say": "Clínica Norte, buenas.", "reply": null, "allow_interruptions": null },
"providers": [ … ],
"defaults": { "llm": "anthropic", "stt": "soniox", "tts": "elevenlabs" },
"models": { "tts/elevenlabs": [ "eleven_flash_v2_5" ] },
"realtime": { "xai": [ "grok-voice-latest", "grok-voice-3.0" ] },
"voice_defaults": { "elevenlabs/es": "a-voice", "google/en": "Kore" },
"calls": 12,
"medians": [ { "name": "transcription_delay", "seconds": 0.13, "turns": 41 } ],
"unavailable_reasons": { "speaks": "elevenlabs has no key: the org brought none and the box holds none" },
"warnings": { "hears": "deepgram/flux-general-multi does not hear ar (it hears en, es, fr, …): take the transcriber out of its settings and Pinecall runs deepgram/nova-3" },
"languages": ["es", "en"],
"suited": { "hears": [ { "vendor": "soniox", "model": "stt-rt-v6", "refused": null } ],
"speaks": [ { "vendor": "elevenlabs", "model": "eleven_flash_v2_5", "refused": "elevenlabs has no key: the org brought none and the box holds none" } ] } }
Each stage is the vendor a call would be built with: the agent's settings, else the providers
row's default for that modality. An agent says the languages its callers speak as its one language
setting, one tag or several with commas between (es, en), the main one first; languages is that list by
base code. Ears and a voice nobody named follow it: where the row's default for the stage does not take those
languages (it does not hear or speak one of them, or it takes one language a call and the agent says several),
the stage is the first of the row's others that does, on a key this org may run it on, said with its model
(Operator API); where none takes them all, the first that takes the main one. Each
stage's languages are the ones its ears listen for, and the ones its voice is asked to speak. A stage the
agent names is never swapped, and warnings says so under hears or speaks when what runs does not take
its languages, with what fixes it: such a call is not refused, it runs and is heard or spoken wrong.
suited lists, for hears and speaks, the row's own models that take every one of the languages, in the
row's order, each with refused: null where this org may run it, else the sentence a call would close with
(not lent, no key). ?language=es,en answers all of it as if the agent were set to those languages, with
nothing kept: the console asks as a person picks them. talks is the realtime model a voice call runs on alone, where the
agent names one ({ "vendor": "xai", "model": "grok-voice-3.0", … }): then its voice calls use
no hears, and speaks only where the realtime model cannot say given words itself (the recording
notice, a greeting given as words, a read-back) — xAI's can, so its calls use no speaks at all — and
decides answers the agent's written calls; null otherwise. Nothing is built to answer. providers are the rows
GET /v1/providers answers this org (Provider keys); defaults and models
are the providers row's, and realtime the models that hear and speak themselves, by vendor, as that
page says. voice_defaults is the row's voice per vendor and language (vendor/language), the one a
call speaks when the agent picked none: what the console's voice picker marks as the default. medians pools every turn of the agent's last twenty calls, livekit's own
field names, the median and not the mean; a measure nobody took has no row. e2e_latency is
the caller's wait to the agent's first sound, as the session writes it
(Metrics), and one row is the runtime's: talk_share, the agent's part
of each call's talking, whose seconds is a fraction 0 to 1 and whose turns counts calls
(Evals). unavailable_reasons
names a stage with no key to run on, in the refusal's own words, so a screen says so before a line
goes dead. When no app holds the agent the stages come from a bare declaration and the settings.
Changing any of it is the agent's settings (Settings), applied on the next call; this endpoint reads.
A live call on the settings as they are now: POST /v1/calls/{call}/stages#
A call keeps the stages it opened on until it ends. This door is how one call takes the model and
the voice its agent's settings name now, without hanging up: whoever changed the settings while on
the call asks it for that call, with a key that holds pipeline. 202 and {"call": ...} once
whatever runs the call was told; 404 for a call nothing runs, 409 for one that is over.
The worker reads the stages again as it did when the call opened (the same scope, the same canary, a
tuning under test) and rebuilds the ones that differ. The reply being said ends in the voice it began
in; the next turn runs on the new stage, with the whole conversation behind it. Each stage that differs is
one stage.changed on the call's log, and a call whose settings name what it
already runs writes nothing.
A call passed to a teammate. With a body {"agent": "<slug>"} the call takes the stages of that
agent instead, and keeps reading them from then on: it is how an app that passes a call from one of its
agents to another gives it the second one's model and voice. A key that holds app may ask this, and
only this; the agent named is one somebody is holding in the key's environment, or 404.
The ears are not rebuilt. They are built once a call, with the turn they end: a new transcriber is
said on the log too, applied false, and runs on the next call.
What it refuses, said as an error entry on the call (refused), the call going on as it was:
- a call on one model that hears and speaks, and settings that now name one.
- a stage its vendor refuses (a key it does not take, a voice it does not have).
A written call the gateway runs itself (the chat door, WhatsApp) has one stage, its model, and takes it the same way: the gateway reads the agent's model again and the next turn thinks with it.
The hold melody — GET · PUT /v1/agents/{slug}/pipeline/hold-audio#
What a caller hears while a tool runs, while the model has not said its first word, and while the
line is held: the runtime's melody, silence, or a clip the org uploaded. It starts once the agent
has been quiet for after_s seconds, so a tool or a model that answers inside the wait plays
nothing, and it stops at the answer. It loops under the agent's voice at 60 %, on the phone and
on the web alike; a written call plays none. One choice per agent per environment, whoever holds
it, read by the next call.
{ "played": "custom", "name": "espera.mp3", "seconds": 41.2, "sha256": "9f2c…", "after_s": 2.5 }
default is the runtime's own melody (the clip livekit ships for holding), and what an agent
nobody chose for plays; off is silence; custom an uploaded clip with the name it arrived
under, its length, and the sha256 of the converted bytes, which is what a worker recognises a
clip it already fetched by. after_s is the wait that plays: the org's, else the runtime's 2.5.
PUT …/hold-audio?name= uploads one, and the body is the file: a wav, an mp3, an ogg, a flac
or an m4a, told apart by its first bytes and nothing else (FFmpeg is named the container and probes
nothing, so a playlist or a script it would otherwise follow is no audio here); no multipart. It
is converted here, once, to Ogg Opus 48 kHz mono, so no worker decodes a stranger's upload
mid-call; 400 in a sentence for a file that is no audio, one longer than five minutes or shorter
than a second, 400 over 20 MB.
GET …/hold-audio/audio is what the agent plays, audio/ogg, to hear before a caller does: the
org's clip, or the runtime's melody; 404 while it plays nothing. PUT …/hold-audio/played {played: "default" | "off"} needs no file; an uploaded clip is forgotten either way.
PUT …/hold-audio/after {after_s: 1.5} sets the wait, from 0 to 30 seconds, and null gives back
the runtime's; 400 in a sentence out of that range. Choosing what plays keeps the wait, and
setting the wait keeps what plays. pinecall pipeline melody is the same five, from a terminal.
The worker's own reads are GET /v1/agents/{slug}/hold-audio and …/audio, on the fleet's key,
in the call's scope.
The class's own. An agent whose class declares its melody (AgentConfig.hold,
Shapes) answers fixed: true, the class's after_s and its off
over the row's, and these doors write nothing for it: PUT …/played, PUT …/after and an upload
are 409 hold set by the class of {slug}: …. The file the class ships comes in by
PUT /v1/agents/{slug}/hold-audio?name=, on the app's own key, beside the worker's reads: it takes
the one file whose sha256 the class declared (clip), 409 for any other and for an agent whose
class declares no melody. The class's own process sends it when the agent registers; the answer
says source_sha256, the hash of the bytes as uploaded, and a second start that reads its hash
there uploads nothing.
Recorded lines — POST /v1/agents/{slug}/lines · GET /v1/lines/{id}.mp3#
A line an app wants a page to play with no call: said once in the agent's own voice and kept, so playing it costs nothing. The voice is the one the agent's next call in the key's environment would speak with (its settings over its class, the providers row, the org's key or the box's lent one), and the lexicon is applied as a call applies it.
POST /v1/agents/pip/lines {"texts": ["Up here are our services."]}
{"lines": [{"id": "9f2c…", "text": "Up here are our services.", "url": "https://…/v1/lines/9f2c….mp3",
"duration_ms": 1610, "voice": "cartesia sonic-3 f786b574-…", "timed": true,
"words": [{"text": "Up", "start_ms": 325, "end_ms": 495}, …]}]}
- A line is kept by a hash of the voice (vendor, model, its options, the voice, the language), the lexicon's forms the text holds, the encoding and the text: asked again, it answers what is kept and records nothing. A changed voice or lexicon is a new line.
wordsare the written words, each with when it is said, in ms from the start. A voice that times its words (Cartesia, over its websocket) gives them (timed: true); a lexicon form that spans words gives its words its time; a voice that times none has each word placed by its length (timed: false).- The audio is MP3, mono, 48 kbps, which every browser plays.
GET /v1/lines/{id}.mp3answers it to any page with no key,Cache-Control: immutable: an id never names other audio. - At most 64 texts a request, 600 characters each. A recording writes no usage row, as a voice sample writes none.
An output explained — POST /v1/agents/{slug}/explain#
A text a page shows (a command's output, 8000 characters at most) that an app wants read aloud with
a finger on its lines: the agent's model, the one its next call in the key's environment would think
with, on the same keys as a call, says up to most (1 to 6, 4 by default) notes on it, each a find,
a fragment copied from one line of the text, and a say, one spoken sentence on that line in language
(the agent's when left out). A note whose fragment is in no line, or a second one on the same line, is
dropped before it is answered; a model that answers anything but notes answers none. command names
what printed the text, for the model alone. Takes an app's or a pipeline key. Like a recording it writes
no usage row: a page's door paces what it asks for.
{ "output": " org lesson · key k_1234 · sandbox\n a person's key: the sandbox without --prod", "command": "pinecall whoami", "language": "es" }
→ { "notes": [{ "find": "org lesson", "say": "Tu org es lesson, y estás en el sandbox." }] }
Published documents — PUT · GET /v1/agents/{slug}/public/{name}#
A JSON object an agent's app publishes for any page to read with no key: what a page needs
before a call opens (the lines it may play, and what they are). PUT with an app's or the
pipeline's key replaces it whole, at most 64 KB; the name is lower case letters, digits and
dashes. GET needs no key: the agent's org is the one its log belongs to, and ?env=sandbox reads
the sandbox's (production's otherwise). It is cached a minute. Anything put there is public:
publish only what the page would show anyway.