Dynamics API

Generate and manage conversational gesture animations — waves, nods, laughs, idle motions — for an avatar.

Overview

Dynamics are conversational gesture animations (wave, nod, laugh, idle motions) for an avatar. Generate them asynchronously, then toggle them on to make the gesture model the active one for live sessions. During conversation, gestures trigger based on keyword mapping. Dynamics generation costs 250 credits.

Generate dynamics

POST /v1/dynamics/generate — generate movements for an agent. Returns immediately with processing; use the GET endpoint to check completion.

ParameterTypeRequiredDefaultDescription
agent_idstringyesAgent ID to generate dynamics for.
image_urlstringnofrom agentSource image URL. Defaults to the agent’s primary image.
durationnumberno5Duration of each motion in seconds.
modelstringnoqualityModel variant: quality, speed, or auto.
import requests

resp = requests.post(
    "https://api.bithuman.ai/v1/dynamics/generate",
    headers={"Content-Type": "application/json", "api-secret": "YOUR_API_SECRET"},
    json={"agent_id": "A91XMB7113", "duration": 5, "model": "quality"},
)
print(resp.json())
{
  "success": true,
  "message": "Dynamics generation started",
  "agent_id": "A91XMB7113",
  "status": "processing"
}

Duration guidance: 1–3 s for quick gestures (waves, nods), 3–5 s for standard motions (default), 5–10 s for extended animations.

Model options: quality (high-quality, default), speed (faster alternative), auto (platform picks the best for the input).

Get dynamics

GET /v1/dynamics/{agent_id} — list the current dynamics configuration and available gestures for an agent.

import requests

agent_id = "A91XMB7113"
resp = requests.get(
    f"https://api.bithuman.ai/v1/dynamics/{agent_id}",
    headers={"api-secret": "YOUR_API_SECRET"},
)
gestures = resp.json()["data"].get("gestures", {})
print(list(gestures.keys()))
{
  "success": true,
  "data": {
    "url": "https://cdn.bithuman.ai/assets/dynamics-model.imx",
    "status": "ready",
    "agent_id": "A91XMB7113",
    "gestures": {
      "mini_wave_hello": "https://cdn.bithuman.ai/assets/mini_wave_hello.mp4",
      "talk_head_nod_subtle": "https://cdn.bithuman.ai/assets/talk_head_nod_subtle.mp4",
      "blow_kiss_heart": "https://cdn.bithuman.ai/assets/blow_kiss_heart.mp4"
    }
  }
}
FieldTypeDescription
urlstring | nullURL to the dynamics model file, or null if not yet generated.
statusstringgenerating while in progress, ready when complete.
agent_idstringThe agent ID.
gesturesobjectMap of gesture action name → video URL.

Before generation completes, url is null and gestures is an empty object.

Update dynamics

PUT /v1/dynamics/{agent_id} — update the dynamics configuration. After a successful update, background-movements regeneration is automatically triggered.

ParameterTypeRequiredDescription
dynamicsobjectyesConfiguration to merge with existing data.
dynamics.enabledbooleannoEnable or disable dynamics for this agent.
toggle_enabledbooleannotrue switches to the dynamics model; false restores the default talking model.
{
  "dynamics": { "enabled": true },
  "toggle_enabled": true
}
{
  "success": true,
  "message": "Dynamics updated successfully and movements regeneration started",
  "agent_id": "A91XMB7113",
  "regeneration_status": "started"
}

If regeneration fails to start, regeneration_status is failed and a regeneration_error message is included.

Gesture names

Generated gestures use descriptive action identifiers. The exact set depends on what was generated — call GET /v1/dynamics/{agent_id} to discover them.

Gesture actionCategoryTypical use
mini_wave_hellowaveGreeting
talk_head_nod_subtlenodAgreement, acknowledgment
blow_kiss_heartexpressionPlayful reaction
laugh_reactexpressionHumor response
idle_subtleidleBackground movement

These action names are what you pass to VideoControl(action=...) or the trigger_dynamics RPC in a live session.

Error codes

HTTPMeaning
400Invalid parameters.
401Unauthorized.
402Insufficient credits.
404Agent not found (DYNAMICS_NOT_FOUND if no dynamics for the agent).
500Internal server error.

See the full error reference and the interactive API reference.