Animaze API

Intro

The Animaze API enables 3rd party apps to control certain functions (e.g. load avatar) or get certain info (e.g. list of ready to use avatars) of/from the Animaze Desktop application. The API is implemented using a websocket that exchanges JSON messages between the Animaze app and 3rd party clients.

If you are looking into making your app control the avatar’s expressions and body motions, best to look into our Programmable Tracker, which allows for you to directly retarget your tracking data to the avatar. Read more here.

If you are looking into making your app control the avatar’s body (full body tracking or hands tracking), best to look into using the VMC protocol, as Animaze supports it. Here is a user-facing guide: Animaze VMC protocol Body Tracker Usage Guide

Setup

The Animaze API websocket uses by default ws://localhost:9000 address.

Animaze is not accepting commands by default, so you need to activate the API from Settings > Animaze API > Enabled. The Port number can also be changed from Settings > Animaze API in the Animaze Desktop app.

Present and future API settings will reside in Settings > Animaze API, so be sure to check them from time to time.

Overview

The Animaze API supports commands or actions (send a command, receive a response) and in the future will also support triggers, Animaze state changes broadcasted to all clients (e.g. the avatar changed)

Actions

Actions are messages sent to Animaze that describe a specific command that needs to be executed and provide a response.

Action request example

{ "action": "LoadAvatar", // required by all action messages "id": "0E9AA4AE-8C70-4999-BFAE-4D639A3F73E2", // optional "name": "Avatar03" // required by the "LoadAvatar" action }

An action response will echo the “action” field and “id“ field if present (use this to link your original request with it’s response for a better management) and an optional “error“ message in case the command failed.

Action response example

{ "action": "LoadAvatar", "id": "0E9AA4AE-8C70-4999-BFAE-4D639A3F73E2", "error": "Avatar not found" }

Triggers

Triggers are messages sent by Animaze to all connected clients with information about state changes initiated by the app.

Trigger example

{ "event": "AvatarChanged", // changed state "new_avatar": "AvatarBomb" // state value }

API Reference (Actions)

Load Avatar

Send to Animaze

Receive from Animaze

same command

Load Scene

Receive from Animaze

same command

Get Avatars

Get the list of ready to use avatars (.avatar files are already on disk).

Send to Animaze

Receive from Animaze

Get Current Avatar Info (available only on next-version branch of Animaze App)

Get advanced info on a list of currently loaded avatars. The command returns a list so that it covers the Animaze Rooms scenario where there are multiple avatars spawned.

Send to Animaze

Receive from Animaze

Get Scenes

Get the list of ready-to-use scenes (.avatar files are already on disk).

Send to Animaze

Receive from Animaze

Get Current Scene Info (available only on next-version branch of Animaze App)

Get advanced info on the currently loaded scene.

Send to Animaze

Receive from Animaze

Get Item Icon

Get the item’s icon as base64 encoded image. This function works for all Animaze items, such as: avatars, scenes, props, emotes, voice effects, etc.

Send to Animaze

Receive from Animaze

Get Emotes

Get the list of ready to use emotes (.avatar files are already on disk).

Send to Animaze

Receive from Animaze

Trigger Emote

Triggers an emote

Send to Animaze

Receive from Animaze

same command

Get Special Actions

Get the special actions list of the current avatar

Send to Animaze

Receive from Animaze

Trigger Special Action

Start a special action on the current avatar

Send to Animaze

Receive from Animaze

same command

Get Poses

Get the special poses list of the current avatar

Send to Animaze

Receive from Animaze

Trigger Pose

Set the pose for the current avatar

Send to Animaze

Receive from Animaze

same command

Get Idle Anims

Get the idle animations list of the current avatar

Send to Animaze

Receive from Animaze

Trigger Idle

Set the idle animations for the current avatar

Send to Animaze

Receive from Animaze

same command

Get Quickscenes

Get the ready-to-use Quickscenes list

Send to Animaze

Receive from Animaze

Load Quickscene

Loads the Quickscene

Send to Animaze

Receive from Animaze

same command

Save Quickscene

Triggers saving current setup (avatar, scene, camera placement, voice effects, etc.) to be saved as a Quickscene.

Send to Animaze

Receive from Animaze

same command

Calibrate Tracker

Trigger Animaze’s tracker calibration function

Send to Animaze

Receive from Animaze

same command

Broadcast

Enables virtual camera broadcast.

Send to Animaze

Receive from Animaze

same command

Set Camera Transform

Sets a custom World Space transformation to the render camera. Camera transformation is right-handed (OpenGL).

Send to Animaze

Receive from Animaze

same command

Get Camera Transform

Gets render camera’s World Space Transformation. Camera transformation is right-handed (OpenGL).

Send to Animaze

Receive from Animaze

 

Set Camera Fov

Sets a a new Fov to the render camera. Fov must be given in degrees.

Send to Animaze

Receive from Animaze

same command

Get Camera Fov

Gets render camera’s Fov

Send to Animaze

Receive from Animaze

Set Avatar Transform

Sets a custom Word Space transformation to the render camera. Camera transformation is right-handed (OpenGL).

Send to Animaze

Receive from Animaze

same command

Get Avatar Transform

Gets render camera’s World Space Transformation. Camera transformation is right-handed (OpenGL).

Send to Animaze

Receive from Animaze

Set Override

Activates/deactivates one of the following override behaviors on the current avatar. Parameters are optional:

Follow Mouse Cursor

Send to Animaze


Mouse Keyboard Behavior

Send to Animaze


Tracked Blinking

Send to Animaze


Auto Blink

Send to Animaze


Look At Camera

Send to Animaze


Look At Camera Head

Send to Animaze


Cross Eyes

Send to Animaze


Pupil Behavior

Send to Animaze


Forced Symmetry Eyebrows

Send to Animaze


Forced Symmetry Eyelids

Send to Animaze


Forced Symmetry Mouth

Send to Animaze


Enhanced Body Movement 2D

Send to Animaze


Enhanced Body Movement 3D

Send to Animaze


Extreme Head Angles Attenuation

Send to Animaze


Sound to Mouth Open

Send to Animaze


Alternate lipsync Retargeting

Send to Animaze


Idle Intensity

Send to Animaze


Inferred Body Yaw Movement

Send to Animaze

Breathing Behavior

Send to Animaze

 

Receive from Animaze

same command

Get Override

Returns the status of an override behavior (activated/deactivated) and its current parameters, applied on the current avatar.

Follow Mouse Cursor

Send to Animaze

Receive from Animaze


Mouse Keyboard Behavior

Send to Animaze

Receive from Animaze


Tracked Blinking

Send to Animaze

Receive from Animaze


Auto Blink

Send to Animaze

Receive from Animaze


Look At Camera

Send to Animaze

Receive from Animaze


Look At Camera Head

Send to Animaze

Receive from Animaze


Cross Eyes

Send to Animaze

Receive from Animaze


Pupil Behavior

Send to Animaze

Receive from Animaze


Forced Symmetry Eyebrows

Send to Animaze

Receive from Animaze


Forced Symmetry Eyelids

Send to Animaze

Receive from Animaze


Forced Symmetry Mouth

Send to Animaze

Receive from Animaze


Enhanced Body Movement 2D

Send to Animaze

Receive from Animaze


Enhanced Body Movement 3D

Send to Animaze

Receive from Animaze


Extreme Head Angles Attenuation

Send to Animaze

Receive from Animaze


Sound to Mouth Open

Send to Animaze

Receive from Animaze


Alternate lipsync Retargeting

Send to Animaze

Receive from Animaze


Idle Intensity

Send to Animaze

Receive from Animaze


Inferred Body Yaw Movement

Send to Animaze

Receive from Animaze

Breathing Behavior

Send to Animaze

Receive from Animaze

Send Message to Animaze ChatPal

Send a prompt to Animaze ChatPal, and receive the conversational AI response, while the avatar starts speaking. You can use this command as echo (for the text-to-speech functionality) as well by adding -echo at the start of the “message“ string.

Send to Animaze

Receive from Animaze

 


API Reference (Triggers)

Animaze ChatPal Speech Start/End Events (available only on next-version branch of Animaze App)

ChatbotSpeechStarted and ChatbotSpeechEnded events are sent by Animaze when ChatPal agent starts and stops speaking (start and end of audio). These events aren’t extremely accurate and depend on the voice engine, but the error could be that the ChatbotSpeechStarted is sent slightly earlier and ChatbotSpeechEnded is sent slightly later. Error is empirically determined up to 1 second.


Sample

You can check out a sample Python script that uses all the available actions at this time. Here’s the archive:

The “AnimazeAPITest.py“ script iterates through all commands in the “commands.json” file and sends them through the websocket.

Requirements:

  • Python 3.11+

  • Python modules: websockets