Skip to main content
The odyssey package provides an async Python client for interacting with Odyssey’s audio-visual intelligence.
Requires Python 3.12+
FeatureMinimum Version
Core SDK^1.0.0
Recordings^1.0.0
Simulate API^1.0.0
Broadcast^1.1.0

Installation

pip install git+https://github.com/odysseyml/odyssey-python.git

API Summary

Methods

SignatureDescription
connect(**handlers) -> NoneConnect to a streaming session (raises on failure)
disconnect() -> NoneDisconnect and clean up resources
start_stream(prompt, portrait?, image?, broadcast?) -> strStart an interactive stream. Supports broadcast=True to enable shared playback for spectators.
When enabled, playback details are delivered via the on_broadcast_ready callback
interact(prompt) -> strSend a prompt to update the video
end_stream() -> NoneEnd the current stream session
get_recording(stream_id) -> RecordingGet recording URLs for a stream
list_stream_recordings(limit?, offset?) -> StreamRecordingsListList user’s stream recordings
simulate(script) -> SimulationJobInfoCreate an async simulation job (v1.0.0+)
get_simulate_status(id) -> SimulationJobDetailGet simulation job status (v1.0.0+)
list_simulations(limit?, offset?) -> SimulationJobsListList simulation jobs (v1.0.0+)
cancel_simulation(id) -> NoneCancel a simulation job (v1.0.0+)
connect_to_stream(webrtc_url?, spectator_token?, on_video_frame?, on_disconnected?, debug?) -> SpectatorConnectionConnect as a spectator to an existing broadcast stream using WebRTC/WHEP.
Use this when you have the webrtc_url and spectator_token provided by the streamer via on_broadcast_ready.
(v1.0.19+)

Properties

PropertyTypeDescription
is_connectedboolWhether connected and ready
current_statusConnectionStatusCurrent connection status
current_session_idstr | NoneCurrent session ID
broadcast_infoBroadcastInfo | NoneContains latest broadcast playback details

Event Handlers

HandlerParametersDescription
on_connected-WebRTC connection established
on_disconnected-Connection closed
on_video_frameframe: VideoFrameVideo frame received
on_stream_startedstream_id: strInteractive stream ready (stream_id can be used for recordings)
on_stream_ended-Interactive stream ended
on_interact_acknowledgedprompt: strInteraction processed
on_stream_errorreason, messageStream error occurred
on_errorerror: Exception, fatal: boolGeneral error
on_status_changestatus, message?Connection status changed
on_broadcast_readyinfo: BroadcastInfoFired when broadcast playback details are available (only when broadcast=True)

Exceptions

ExceptionDescription
OdysseyErrorBase exception for all Odyssey errors
OdysseyAuthErrorAuthentication failed (invalid API key)
OdysseyConnectionErrorConnection failed (no streamers, timeout)
OdysseyStreamErrorStream operation failed

Next Steps