kugel-agent-1. You choose instructions, function tools, a numeric voice
identifier, and the audio wire format. Recognition, turn detection, reasoning,
speech planning, and synthesis providers remain server-managed.
Authenticate
Server applications can connect with their project API key:Configure a session
The server first sendssession.created. Select a numeric voice identifier
before requesting output:
session.updated. When present,
instructions is the instruction character count and tools lists the
session’s declared tool names; the server does not echo the full effective
configuration. The selected voice is applied to synthesis and becomes immutable
when the first output begins. Per-message voice overrides are not supported.
Send audio
Supported formats are:
For JSON transport, send:
input_audio_buffer.speech_started and
input_audio_buffer.speech_stopped and automatically commits a detected
speech boundary. A client may also explicitly commit the current buffer:
input_audio_buffer.clear to discard buffered, uncommitted audio. Clearing
input does not cancel an active response; use response.cancel for that.
Each commit produces input_audio_buffer.committed, transcription updates,
and one completed user conversation item through the deployment’s private
perception runtime. Recognition candidates, confidence values, provider
versions, endpoint scores, and endpointing controls remain server-side.
Request an agent response
After a committed user turn, request model-authored speech with:response configuration returns a not_implemented error and does not start a
response:
function_call conversation item followed by
response.function_call_arguments.done. Return the exact call_id:
error, for example
"{\"error\":\"user not found\"}". The runtime exposes that as a failed tool
outcome rather than a successful result, allowing the agent to recover without
claiming that the operation succeeded.
For identity-bearing arguments such as account IDs, declare
identity_arguments alongside the JSON schema:
Speak exact fixed text
Aforce_message speaks client-authored text directly. Sending the item is
the entire request; do not follow it with response.create.
output_text part with at most 2,000 Unicode
code points. It does not accept SSML, audio parts, tool calls, or
per-message voices.
Fixed speech uses the same serialized output floor as agent-authored speech.
If interruptible is false, caller audio received during playback is
discarded and the server emits kugel.input_audio.suppressed.
Response lifecycle
A successful audio response uses this lifecycle:response.output_audio.delta contains encoded audio.
With binary output, audio chunks are raw binary frames and lifecycle metadata
remains JSON. The final transcript for a fixed message equals its supplied
text. response.done is emitted only after the client reports a terminal
played span; sending bytes to a socket is not treated as audible playout.
Audio deltas are emitted incrementally as synthesis produces them.
response.output_audio_transcript.done is ordered behind the final audio frame
for its clause. Clients should not send a terminal playout acknowledgement
until they have received this marker and actually played the scheduled audio.
When final reasoning takes longer than the Speaker’s bridge decision, one
response can contain two separately identified clauses: a short
Speaker-authored bridge followed by the substantive answer.
After playing audio, report the exact cumulative sample and Unicode-code-point
cut:
completed only when the full text and produced audio were played. Partial
acknowledgements update history with the exact prefix but do not release the
output floor. When caller speech interrupts an interruptible response, the
server estimates the heard prefix from emitted samples and synthesis word
timestamps, emits response.output_audio.done for that prefix, and then emits
response.cancelled. Do not acknowledge a response after it is cancelled.
Offsets that regress, exceed produced output, or identify another item fail
explicitly.
Cancel the active or named interruptible response with:
response.cancelled after recording its best estimate of the
heard prefix. Speech beyond that prefix is not added to conversation history.
conversation.item.truncate is reserved by the schema but is not implemented
by the current shared runtime.
Client events
Server events
conversation.item.truncate is schema-reserved but is not
handled by the current shared runtime.