Table of Contents

VoxAI Plugin API Reference

Last Updated: 02/20/2026 (v1.2.1)

This reference lists the methods and attributes available via the app object passed to your plugin's register(app) function.


πŸŽ™οΈ Audio Engine & Lip Sync

Plugins can listen to the raw volume levels of the bot's voice to create avatars, visualizers, or reactive lighting.

How to use: Register an event handler for audio_level.


🧠 Core AI & Interaction

app.ask_ai(prompt) Sends a text prompt to the currently active AI provider (GPT or Gemini) and gets a direct response.

app.speak_text(text) Generates audio from text and plays it immediately through the configured output device.

app.synthesize_tts(text) Generates audio bytes but does not play them. Use this to prepare audio for the audio_queue.

app.add_chat(message) Writes a message directly into VoxAI’s main chat log window.

app.persona (string) Read-only attribute containing the name of the currently active AI persona.


πŸ’Ύ Memory & Context

app.last_stream_category (string) Retrieve the name of the game currently being played on Twitch (e.g., β€œMon Bazou”). Updated automatically via EventSub. Use this to make AI prompts game-aware.

app.add_to_persona_local_memory(username, message) Adds a line to the persona's β€œshort-term memory” file for the current session.

app.get_persona_local_memory_lines() Retrieves the recent lines from short-term memory as a list.


πŸ“‘ Twitch Interaction

app.send_twitch_chat(message) Sends a message to Twitch chat. (Thread-safe).

app.send_api_whisper(target_username, message) Sends a reliable whisper via the Twitch API.

app.create_clip() Triggers a clip of the stream and posts the URL to chat.

app.channel (string) The streamer’s lowercase username.

app.is_channel_live() β†’ bool app.get_broadcaster_id() β†’ string


⚑ Event Hooks

Register these with app.register_event_handler(event_name, function).

Stream Events

app.register_command(name, function) Registers a !command. Updated in v1.2.1: Handler must now accept (args, user, tags=None).

app.plugin_chat_hooks (list) Append a function to this list to read every single chat message. Updated in v1.2.1: Hook function should now accept (user, message, tags=None).


🎬 OBS Control

app.obs_switch_scene(scene_name) app.obs_set_source_visibility(scene, source, visible) app.obs_set_filter_enabled(source, filter, enabled) app.obs_flip_source(scene, source, direction)


🎨 Overlays & UI

app.add_plugin_menu_command(label, command) Adds a clickable item to the β€œPlugins” top dropdown menu.

app.master Reference to the root window (required for creating tk.Toplevel or customtkinter windows).


πŸ“š Included Libraries

VoxAI imports these libraries globally. You can use them in your plugins without any additional installation.