Skip to main content
WSS
method
type:string

GET

query
type:object
Append text
type:object

Append text to a context's buffer. The first input.text for a context_id opens the context. Does not generate audio on its own.

Flush and generate
type:object

Generate the context's buffered text as its next segment. The context stays open.

Close context
type:object

No more text for this context. The rest of its buffer is generated, all audio is delivered, then context.done arrives with reason completed.

Cancel context
type:object

End the context now: generation in progress is stopped, queued and unflushed text is discarded, and context.done arrives with reason cancelled. No audio for the context is sent after it. Ignored if the context has already ended.

Close session
type:object

Finish every open context as if each received context.close, then close the connection.

Ping
type:object

Keep the connection alive. Answered with pong.

Session ready
type:object

The connection is authenticated and ready.

Segment started
type:object

A segment of a context is about to stream.

Audio
type:object

Audio for a segment.

Segment finished
type:object

The segment has finished streaming. Carries the credits charged for it.

Context ended
type:object

The last message for a context, whatever ended it.

Error
type:object

A message was rejected. The connection stays open unless code is insufficient_credits (closes with 4402) or idle_timeout (closes with 1008).

Session complete
type:object

Sent after session.close once every context has finished. The connection then closes with code 1000.

Pong
type:object

Answer to ping.