Skip to content

Realtime API Events

Speak

request.speak.text

Make the robot say something using text-to-speech.

ParameterTypeRequiredDefaultDescription
textstringThe text to speak
abortbooleanfalseAbort any earlier planned or ongoing speech. If false, new speech is queued
monitor_wordsbooleanfalseWhether to send back response.speak.word while speaking

request.speak.audio

Make the robot play/say some audio from a URL. The audio must be in WAV format (not MP3).

ParameterTypeRequiredDefaultDescription
urlstringThe url from which to play audio
textstring"AUDIO"The corresponding text (for display purposes)
lipsyncbooleantrueWhether to perform lipsync
abortbooleanfalseWhether to abort any earlier planned or ongoing speech

request.speak.stop

Make the robot stop speaking and/or abort any planned speech, or speech being generated.

response.speak.start

The robot has started speaking.

ParameterTypeRequiredDefaultDescription
textstringThe synthesized text
gen_timenumberTime to synthesize (ms)

response.speak.end

The robot has stopped speaking.

ParameterTypeRequiredDefaultDescription
textstringThe synthesized text (what was actually said if aborted)
abortedbooleanfalseWhether the speech was stopped prematurely
failedbooleanfalseWhether the speech synthesis failed

response.speak.word

Sent while speaking, if monitor_words is true.

ParameterTypeRequiredDefaultDescription
wordstringThe word spoken
indexnumberThe index of the word spoken

Speak (Streaming)

request.speak.audio.start

Start speaking from streaming audio.

ParameterTypeRequiredDefaultDescription
sample_rateint16000The sample rate of the audio data
lipsyncbooleantrueWhether to add automatic lipsync

request.speak.audio.data

Send audio data for streaming speech.

ParameterTypeRequiredDefaultDescription
audiostringBase64-encoded audio data, 16-bit, mono, little-endian

request.speak.audio.end

Marks the end of audio data transmission. This should be sent after all audio chunks have been sent.

request.speak.stop

Stop speaking immediately. This command can be used to halt audio playback at any time.

response.speak.end

This event is sent back when all audio has been played.

response.speak.audio.buffer

This event is sent back with the current audio buffer status while audio is being played.

ParameterTypeRequiredDefaultDescription
playedintThe number of bytes of audio played
receivedintThe number of bytes of audio received

Listen

request.listen.config

Configure speech recognition.

ParameterTypeRequiredDefaultDescription
languageslist["en-US"]List of languages to listen for
phraseslist[]List of words or phrases to listen extra carefully for

request.listen.start

Make the robot listen for speech. If it is already listening, it will reset the current result.

ParameterTypeRequiredDefaultDescription
partialbooleanfalseWhether to produce results while user is speaking
concatbooleantrueWhether to concatenate results during the same listening session
stop_no_speechbooleantrueStop listening if user silent for too long (no_speech_timeout)
stop_robot_startbooleantrueStop listening when robot start speaking
stop_user_endbooleantrueStop listening when end-of-speech is detected
resume_robot_endbooleanfalseResume listening when robot stopped speaking
no_speech_timeoutnumber8.0Timeout to use for stop_no_speech (seconds)
end_speech_timeoutnumber1.0Amount of silence needed to detect end-of-speech (seconds)

request.listen.stop

Force the robot to stop listening.

response.listen.start

The robot has started listening for speech.

response.listen.end

The robot has stopped listening for speech.

ParameterTypeRequiredDefaultDescription
causestringThe reason for stopping: 'stopped', 'robot_speak', 'speech_end', 'silence_timeout'

response.hear.start

The user has started speaking, or re-started speaking if listening continued.

response.hear.end

The user has stopped speaking and speech is recognized.

ParameterTypeRequiredDefaultDescription
textstringRecognized speech

response.hear.partial

The robot has recognized partial speech from the user. These events are only sent if partial results are requested.

ParameterTypeRequiredDefaultDescription
textstringRecognized speech

Voice

request.voice.config

Set the current voice, using either voice id, name, language, gender, or provider (or a combination).

ParameterTypeRequiredDefaultDescription
voice_idstringVoice ID
namestringVoice name (partial, case insensitive)
providerstringVoice provider (partial, case insensitive)
languagestringVoice language (e.g. en-US)
genderstringVoice gender (male/female)
input_languagebooleantrueSet input language to same as voice

request.voice.status

Gets the current and available voices.

ParameterTypeRequiredDefaultDescription
voice_idbooleantrueCurrent voice id
voice_listbooleantrueList of available voices

response.voice.status

Returns current and available voices.

ParameterTypeRequiredDefaultDescription
voice_idstringnullCurrent voice id
voice_listlistnullList of available voices

Attention

request.attend.user

Make the robot attend to a user. If the user is lost, the robot will attend nobody. If the user comes back later, the robot will attend to that user again. If the 'closest' user is specified, the robot will always attend the closest user.

ParameterTypeRequiredDefaultDescription
user_idstringclosestThe ID of the user to attend, or 'closest'
slack_pitchnumber15Max difference (deg) between head pitch and gaze pitch
slack_yawnumber5Max difference (deg) between head yaw and gaze yaw
slack_timeoutnumber3000Max time (ms) head direction can diverge from gaze (-1 is infinite)
speedstringmediumSpeed of head movement (xslow, slow, medium, fast, xfast)

request.attend.location

Make the robot attend to a specific location, as specified in meters, relative to the robot.

ParameterTypeRequiredDefaultDescription
xnumberHorizontal position
ynumberVertical position
znumberDistance from robot
slack_pitchnumber15Max difference (deg) between head pitch and gaze pitch
slack_yawnumber5Max difference (deg) between head yaw and gaze yaw
slack_timeoutnumber3000Max time (ms) head direction can diverge from gaze (-1 is infinite)
speedstringmediumSpeed of head movement (xslow, slow, medium, fast, xfast)

request.attend.nobody

Make the robot attend to nobody.

response.attend.status

The robot's attention status has changed.

ParameterTypeRequiredDefaultDescription
targetstringThe target attention (nobody, location, closest, user-id)
currentstringThe current attention (nobody, location, user-id)

Gestures

request.gesture.start

Make the robot perform a gesture.

ParameterTypeRequiredDefaultDescription
namestringName of the gesture (see API for values)
intensitynumber1.0Intensity of the gesture
durationnumber1.0Duration of gesture
monitorbooleanfalseWhether to receive events when gesture starts and ends

response.gesture.start

Received when the gesture starts.

response.gesture.end

Received when the gesture ends.

Face

request.face.params

Set facial animation parameters directly.

ParameterTypeRequiredDefaultDescription
paramsobjectFace parameters

request.face.headpose

Control the head pose of the robot, as specified in degrees along yaw, pitch and roll.

ParameterTypeRequiredDefaultDescription
yawnumber0Yaw (sideways) angle in degrees
pitchnumber0Pitch (up/down) angle in degrees
rollnumber0Roll angle in degrees
relativebooleanfalseWhether to use relative or absolute control
speedstringmediumSpeed of head movement (xslow, slow, medium, fast, xfast)

request.face.config

Set the current mask and character (face_id), and/or face visibility.

ParameterTypeRequiredDefaultDescription
face_idstringKEEPface ID
visibilitybooleantrueTurn on or off face visibility
microexpressionsbooleantrueTurn on or off facial microexpressions
blinkingbooleantrueTurn on or off blinking
head_swaybooleanfalseTurn on or off automatic minor head sways

request.face.status

Gets the current and available masks and characters (face_id).

ParameterTypeRequiredDefaultDescription
face_idbooleantrueCurrent face id
face_listbooleantrueList of available faces

request.face.reset

Resets all facial parameters to default.

response.face.status

Returns current and available masks and characters (face_id).

ParameterTypeRequiredDefaultDescription
face_idstringnullCurrent face id
face_listlistnullList of available faces

LED

request.led.set

Set the color of the LED.

ParameterTypeRequiredDefaultDescription
colorstringColor in hex format

Users

request.users.once

Detect users once.

request.users.start

Start detecting users.

request.users.stop

Stop detecting users.

response.users.data

New users are detected, users are lost, or users move.

ParameterTypeRequiredDefaultDescription
userslistList of user objects, sorted by proximity

Audio

request.audio.start

Start capturing audio from the microphone and/or speaker. Per default, only microphone will be captured.

ParameterTypeRequiredDefaultDescription
sample_rateint16000The sample rate of the audio data to receive
microphonebooleantrueWhether to capture the microphone
speakerbooleanfalseWhether to capture the speaker

request.audio.stop

Stops capturing audio from the microphone and/or speaker.

response.audio.data

Audio data.

ParameterTypeRequiredDefaultDescription
microphonestringBase64-encoded audio data, 16-bit, mono, little-endian
speakerstringBase64-encoded audio data, 16-bit, mono, little-endian

Camera

request.camera.once

Capture one frame from the camera.

request.camera.start

Start capturing video from the camera.

request.camera.stop

Stops capturing video from the camera.

response.camera.data

Camera video data.

ParameterTypeRequiredDefaultDescription
imagestringBase64-encoded jpeg image