Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Live

Create session
client.Live.New(ctx, body) (*LiveNewResponse, error)
POST/live/sessions
ModelsExpand Collapse
type AudioFormatUnion interface{…}

Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. WebRTC and SIP negotiate their media format separately.

type BuiltInVoice string

A built-in voice available for Live speech.

type ClientConfig struct{…}

Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.

type ClientDelegation struct{…}

Delegate tasks to your application. The Live session emits delegation events that your backend handles.

type ClientEventUnion interface{…}

Client events for Live. Initialize a primary WebSocket with session.start and wait for session.started. WebRTC creation already starts the session. Audio append is primary WebSocket-only. See the Live prompting guide before writing frontend instructions and delegation policies.

type CommentaryAppendEvent struct{…}

Provide context the Live model can communicate to the user, optionally for an existing client delegation.

type CommentaryAppendedEvent struct{…}

Returned when a session.commentary.append command is accepted into the Live session timeline. Acknowledges the added commentary without guaranteeing exact wording or completed audio playback.

type CustomVoice struct{…}
type DataChannelConfig struct{…}

Control which Live events an untrusted WebRTC frontend can send and receive over its data channel. These restrictions do not apply to trusted sideband connections.

type DelegationCreatedEvent struct{…}

Returned when the Live model delegates work to your application or a Responses backend. Contains delegation metadata and the position on the session timeline where the work was delegated.

type Error struct{…}

Details of an error encountered by the Live session, including the affected parameter or client command when available.

type ErrorEvent struct{…}

Reports an error in the Live session, such as an invalid client command. Use error.client_event_id, when present, to identify the command that caused the error.

type ForkSessionConfig struct{…}

Overrides for a stored session after connecting to the fork WebSocket. An empty object inherits the stored configuration; do not supply a new model. audio.format applies only to the new WebSocket connection. client overrides are only supported for WebRTC forks.

type ForkSessionStartEvent struct{…}

Start a Live session after connecting to a stored session’s fork WebSocket. Send an empty session object to use the stored configuration.

type FunctionTool struct{…}

A function tool available to the Responses backend when the Live model delegates a task.

type InfoEvent struct{…}

An informational notice about the Live session, such as the event permissions applied to a frontend data channel.

type InitialItemUnion interface{…}

A developer, user, or assistant message supplied as text history before the Live session starts.

type InputAudioAppendEvent struct{…}

Send audio to a Live session over its primary WebSocket. WebRTC and SIP sessions send audio over their media transport.

type InputAudioMuteEvent struct{…}

Mute audio input to the Live model without closing the session. The server acknowledges with session.input_audio.muted.

type InputAudioMutedEvent struct{…}

Returned when a session.input_audio.mute command is accepted. Input audio is no longer sent to the model; sideband audio reflection continues.

type InputAudioUnmuteEvent struct{…}

Resume audio input to a Live model after muting it. The server acknowledges with session.input_audio.unmuted.

type InputAudioUnmutedEvent struct{…}

Returned when a session.input_audio.unmute command is accepted. Input audio is sent to the model again.

type InputTranscriptDeltaEvent struct{…}

A transcript fragment for user input audio in the Live session. Accumulate fragments in delivery order; these events do not define complete turns or include a transcript-done event.

type InstructionsAppendEvent struct{…}

Append instructions to the Live conversation while it is running, optionally associating them with an existing client delegation.

type InstructionsAppendedEvent struct{…}

Returned when a session.instructions.append command is accepted into the Live session timeline. Acknowledges the appended instructions without guaranteeing that the model has acted on them.

type MediaSessionConfig struct{…}

Startup configuration for a Live media session. Follow the Live prompting guide when writing frontend instructions and the backend prompt under delegation.responses.instructions.

type MediaSessionForkConfig struct{…}

Optional overrides for a stored Live session. Omitted settings are inherited. The model, voice, frontend instructions, and prior conversation come from the stored session. WebRTC negotiates its audio format; audio.format is only supported on WebSocket forks.

type OutputAudioDeltaEvent struct{…}

An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in delivery order using the configured session audio format. Sideband connections receive reflected output audio with timestamps.

type OutputTranscriptDeltaEvent struct{…}

A transcript fragment for assistant output audio in the Live session. Accumulate fragments in delivery order; these events do not define complete turns or include a transcript-done event.

type ResponseCreateEvent struct{…}

Request a response from the Live session’s Responses backend, or continue a delegated response waiting for tool results. Requires Responses delegation.

type ResponseEvent struct{…}

A streaming Responses API event from a backend delegated to by the Live session. Use the outer delegation_id to associate the nested stream with its Live delegation.

type ResponseItemCreateEvent struct{…}

Add an input item to the Live session’s Responses backend. Requires Responses delegation; use response.create to request a response.

type ResponsesDelegationConfig struct{…}

Model, prompt, and tool settings for tasks delegated by the Live session to a Responses backend.

type ResponsesDelegationUpdateConfig struct{…}

Updates to the Responses backend of an existing Live session. Omitted settings retain their current values.

type ServerEventUnion interface{…}

Server events for Live. Response lifecycle events are wrapped inside response.event; dispatch the nested event by its full type and tolerate new response event types. Follow the Live prompting guide when designing the conversation and delegation policy.

type ServerEventSelector struct{…}

A Live server event selector for the WebRTC frontend data channel.

type SessionCloseEvent struct{…}

Request that the Live session close. The terminal session.closed event contains the close reason and final usage.

type SessionClosedEvent struct{…}

Returned after the Live session finishes finalizing, with the close reason, final session snapshot, and cumulative audio usage. A connection closing without this event does not confirm successful finalization.

type SessionConfig struct{…}

Initial configuration for a Live session, including its model, conversation instructions, audio, and delegated task handling.

type SessionResource struct{…}

The resolved Live session configuration and server-assigned session metadata.

type SessionStartEvent struct{…}

Start a Live session on a primary WebSocket. Send this event before other commands and wait for session.started.

type SessionStartedEvent struct{…}

Returned when a Live session has started. Contains the resolved session configuration, including server defaults.

type SessionUpdateConfig struct{…}

Changes to an active Live session. Only delegation backend settings can be updated after startup.

type SessionUpdateEvent struct{…}

Update the delegation settings of an active Live session. The server acknowledges accepted changes with session.updated.

type SessionUpdatedEvent struct{…}

Returned when a Live session update is accepted. Contains the resolved session configuration after the update.

type SessionUsage struct{…}

Cumulative audio duration for a Live session. Values are totals for the session, not increments to sum across usage events.

type SessionUsageUpdatedEvent struct{…}

Reports cumulative Live audio usage and, when available, the most recent context-window usage. Delegated Responses token usage is reported separately in response.event events.

type ThinkingAppendEvent struct{…}

Provide silent reasoning or progress context to the Live model, optionally for an existing client delegation.

type ThinkingAppendedEvent struct{…}

Returned when a session.thinking.append command is accepted into the Live session timeline. Acknowledges the added reasoning context without guaranteeing any spoken output.

LiveForks

ModelsExpand Collapse
type ForkClientEventUnion interface{…}

Client events for a Live fork WebSocket. First send session.start with an overrides object (which may be empty), then wait for session.started before sending other commands. The model and conversation are inherited from the stored session.

type ForkServerEventUnion interface{…}

Server events for Live. Response lifecycle events are wrapped inside response.event; dispatch the nested event by its full type and tolerate new response event types. Follow the Live prompting guide when designing the conversation and delegation policy.

LiveSessions

Accept call
client.Live.Sessions.Accept(ctx, sessionID, body) error
POST/live/sessions/{session_id}/accept
Download recording
client.Live.Sessions.DownloadRecording(ctx, sessionID) (*Response, error)
GET/live/sessions/{session_id}/content
Fork session
client.Live.Sessions.Fork(ctx, sessionID, body) (*SessionForkResponse, error)
POST/live/sessions/{session_id}/fork
Hang up session
client.Live.Sessions.Hangup(ctx, sessionID) error
POST/live/sessions/{session_id}/hangup
Transfer call
client.Live.Sessions.Refer(ctx, sessionID, body) error
POST/live/sessions/{session_id}/refer
Reject call
client.Live.Sessions.Reject(ctx, sessionID, body) error
POST/live/sessions/{session_id}/reject

LiveSideband