Atmee.aiDocs
APIAPI referenceAvatars

Set the conductor

PUT
/v1/avatars/{avatarId}/conductor

Gives a v2 avatar's conversations an agenda: a graph of steps, each with instructions for the avatar and edges that say when to move on. It replaces any earlier conductor, including one the avatar's own configuration carries, and applies from the next session. Nothing is rebuilt.

  • How it runs: after each turn, a judge model scores each edge's when condition. Edges without a condition share the chance that none holds, by weight. The step takes its likeliest edge, or draws one when random. A step without edges is the end. A speak edge lets the avatar go on without waiting for the user, speakAfterS seconds later.
  • Validation: the graph is checked before it is saved. 400 invalid_conductor names the field (e.g. /graph/nodes/2/edges/0/weight); a value of the wrong JSON type is 422. Per-field limits are on the schema.
  • Limits: at most 100 nodes and 100 edges, and 150,000 characters of graph JSON (non-ASCII characters count as their \uXXXX escapes). The request body may be up to 512 KiB. A session whose whole configuration would be too large starts without the conductor.
  • v1 avatars are refused (409 not_v2_avatar).

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Path Parameters

avatarId*string
Formatuuid

Request Body

application/json
  1. body
graph*

The steps of the conversation (nodes) and the one it starts in (start). Every node must be reachable from start. Only start, nodes and reasoning are accepted.

speakAfterS?number

Seconds after an avatar turn before it speaks again along a speak edge, if the user has not spoken. 0.1 to 10; absent or null uses the default, 0.5.

Formatdouble
Range0.1 <= value <= 10

Response Body

Saved; returns the conductor.

application/json
  1. response
avatarId*string
Formatuuid
graph*

The steps of the conversation (nodes) and the one it starts in (start). Every node must be reachable from start. Only start, nodes and reasoning are accepted.

speakAfterS?number

As set; absent when it was not (the default, 0.5, applies).

Formatdouble
nodes*integer

The graph's node count.

edges*integer

The graph's edge count, all nodes together.

Example Request
curl -X PUT 'https://api.atmanity.us/v1/avatars/497f6eca-6276-4993-bfeb-53cbbbba6f08/conductor' \  -H 'Content-Type: application/json' \  -d '{  "graph": {    "start": "string",    "nodes": [      {        "id": "string"      }    ]  }}'
Example Response
{  "avatarId": "ac572b6e-802b-4b9e-a602-0786d4441e67",  "graph": {    "start": "string",    "nodes": [      {        "id": "string",        "instructions": "string",        "edges": [          {            "to": "string",            "when": "string",            "weight": 0.1,            "speak": true          }        ],        "random": true,        "emotion": "string",        "role_play": true,        "languages": [          "string"        ],        "replan": true      }    ],    "reasoning": null  },  "speakAfterS": 0.1,  "nodes": 0,  "edges": 0}