Avatars
An avatar is the persona your users talk to — its face, voice, model, and instructions.
An avatar bundles everything that defines a conversational persona: the appearance it was trained on, the voice it speaks with, the language model behind it, and the system prompt that shapes how it behaves.
Stock and custom avatars
Stock avatars are pre-trained and shared across all accounts. They are ready the
moment you find them, which makes them the right choice for prototyping and for any use
case where a generic presenter is fine.
Custom avatars are trained from video you supply, so they look and sound like a specific person. Training takes time; see Train a custom avatar.
Listing them
There are two listing endpoints and they return different sets. Mixing them up is the most common early mistake:
| Endpoint | Returns |
|---|---|
GET /v1/avatars | Only avatars you created. Excludes stock avatars. |
GET /v1/avatars/stock | Only stock avatars |
There is no combined listing on /v1/ — call both and merge them if you need one
list. Each is paginated with skip and limit (max 100) and returns
{ items, total, skip, limit }.
- cURL
- Python
- Node.js
curl -s "https://backend.goldenengine.ai/v1/avatars?limit=20" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY"
import os
import requests
BASE = "https://backend.goldenengine.ai"
HEADERS = {"X-Api-Key": os.environ["GOLDENENGINE_API_KEY"]}
page = requests.get(f"{BASE}/v1/avatars", headers=HEADERS, params={"limit": 20}).json()
for avatar in page["items"]:
print(avatar["id"], avatar["name"], avatar["status"], avatar["is_stock"])
const BASE = "https://backend.goldenengine.ai";
const headers = { "X-Api-Key": process.env.GOLDENENGINE_API_KEY };
const page = await (await fetch(`${BASE}/v1/avatars?limit=20`, { headers })).json();
for (const avatar of page.items) {
console.log(avatar.id, avatar.name, avatar.status, avatar.is_stock);
}
The is_stock boolean on each avatar tells you which kind you are looking at.
GET /v1/avatars/{avatar_id} fetches one avatar — yours or a stock one — and
GET /v1/avatars/stock/{avatar_id} fetches a stock avatar only, returning 404 for anything
else.
Training lifecycle
A custom avatar moves through five states:
pending → queued → training → ready
↘ failed
| Status | Meaning |
|---|---|
pending | The avatar record exists; training has not been submitted |
queued | The training job was accepted into the queue |
training | A worker is actively training the model |
ready | The checkpoint is saved — the avatar can hold conversations |
failed | Training errored, timed out, or was cancelled; see error_message on the avatar |
Only a ready avatar can start a conversation. Creating one against an avatar in any other
state returns 404.
Poll GET /v1/avatars/{avatar_id}/status while you wait. It reports status,
progress_percent (0–100 through the current run — a completion figure, not a time
estimate), and error_message when a run ends in failed. GET /v1/avatars/{avatar_id}/training-jobs lists the individual
job attempts, each with its own status (pending, running, completed, failed,
cancelled).
Managing a custom avatar
| Endpoint | What it does |
|---|---|
POST /v1/avatars/{avatar_id}/retrain | Re-runs training from the original source video. Returns 202 with the avatar back at pending; 409 while a run is queued or training |
POST /v1/avatars/{avatar_id}/cancel | Stops a queued or training run. The avatar ends failed with an error_message saying it was cancelled; 409 in any other state |
DELETE /v1/avatars/{avatar_id} | Deletes the avatar, its source video, and its training artifacts, aborting any active run first. Returns 204. Documents attached to it are deleted too |
Video requirements
Custom avatars are only as good as the source footage. Recording conditions — framing, lighting, background, how much the subject moves — matter more than camera quality.
To review the footage an avatar was trained from, GET /v1/avatars/{avatar_id}/video-url
returns a signed link to it. The URL is short-lived — expires_in says how long — so fetch
it when you need it rather than storing it.
Configuration
Every avatar carries the settings that shape its behavior. The ones you will set most often:
| Field | What it controls | Default |
|---|---|---|
name, bio | Identity, and the background the model is given | Required |
awards_achievements | Free-text credentials the avatar may mention | None |
known_for, personality_traits, interaction_guardrails | Persona shaping used to build the prompt, from fixed lists | None |
primary_goal | What the avatar is for, in one line | None |
llm_model | Which language model answers | gpt-4o |
web_search_enabled | Whether the avatar may search the web for current facts | true |
guardrail_level, guardrail_fallback_line, guardrail_blocked_words | How strictly its speech is checked before it is spoken — see Guardrails | normal, the default line, none |
tts_provider, voice_id, tts_speed | The synthesized voice and its pace | elevenlabs, the provider's default voice, 1.0 |
stt_engine, stt_speed | How speech is transcribed | deepgram-flux, 1.0 |
primary_language, ai_languages | The language it opens in, and those it can use | "English (US)", none |
knowledge_base_ids | Account bank documents attached to this avatar | None |
See Models for the available engines and voices. The accepted
values for the list fields are listed on the request body in the
API reference. Languages are labels, not codes — "English (US)",
"French", "Mandarin Chinese" — and anything outside the list is rejected with 422.
tts_speed and stt_speed must be greater than zero.
The system prompt is not a field you set. It is generated from the persona fields and
returned read-only as system_prompt; sending system_prompt on create or update is
rejected with 422, as is any other unknown field.
Update an avatar with PATCH /v1/avatars/{avatar_id}, sending only the fields you are
changing. A few changes do more than they appear to:
- Editing
name,bio,awards_achievements,known_for,personality_traitsorinteraction_guardrailsregenerates the system prompt through a model call, so the change is to the brief, not to the wording — and the request can fail with502if that call does.primary_goaland the language fields are stored without regenerating it. - Changing
tts_providerwithout also sendingvoice_idresets the voice to that provider's default.voice_idis not checked against the provider or the catalog, so a mismatched or mistyped voice is accepted — confirm it inGET /v1/modelsfirst. knowledge_base_idsreplaces the avatar's full set of documents; see Knowledge bank.
web_search_enabled lets the avatar look up current facts — news, weather, prices — when
a question needs them. How the search runs depends on the model; see
Models. Set it to false to keep an avatar to its
prompt and documents.
Stock avatars cannot be updated, retrained, or deleted — you do not own them, and there is no public endpoint for overriding their prompt. Create your own avatar when you need a persona of your own. You can still give a stock avatar documents: the knowledge endpoints below work on stock avatars, and what you attach is visible only to your account.
Guardrails
Every sentence an avatar is about to say is checked before it is spoken. What fails the check is never heard and never reaches the transcript — the saved transcript holds only what was actually spoken.
The check runs in layers:
- Profanity filter. Swear words — including disguised spellings like
f*ck, leetspeak and spaced-out letters — are removed from the sentence. This runs at every level,offincluded, and also removes anything in the avatar'sguardrail_blocked_words. - Content classifier. The sentence is scored for toxicity. A rude sentence is rewritten into a polite one and checked again; a sentence that is sexual, hateful, threatening or harmful stops the reply, and the avatar says its fallback line instead. If the very first sentence of a reply is flagged, the avatar goes straight to the fallback line.
Three fields control it, on an avatar you own (stock avatars keep the settings they ship with):
| Field | Values | Default |
|---|---|---|
guardrail_level | off, relaxed, normal, strict | normal |
guardrail_fallback_line | Up to 300 characters, one line of plain text | Empty — "Sorry, I can't help with that. Is there something else I can do for you?" |
guardrail_blocked_words | Up to 200 words or short phrases, 1–50 characters each | None |
guardrail_level sets how readily the classifier acts: strict rewrites and stops at lower
scores than normal, relaxed at higher ones, and off skips the classifier entirely —
the profanity filter still runs. Blocked words are matched as whole words, case-insensitively,
on top of the built-in list; duplicates are removed.
- cURL
- Python
- Node.js
curl -s -X PATCH "https://backend.goldenengine.ai/v1/avatars/$AVATAR_ID" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"guardrail_level": "strict",
"guardrail_fallback_line": "I can only help with questions about your account.",
"guardrail_blocked_words": ["competitor name", "refund guarantee"]
}'
requests.patch(
f"{BASE}/v1/avatars/{avatar_id}",
headers=HEADERS,
json={
"guardrail_level": "strict",
"guardrail_fallback_line": "I can only help with questions about your account.",
"guardrail_blocked_words": ["competitor name", "refund guarantee"],
},
)
await fetch(`${BASE}/v1/avatars/${avatarId}`, {
method: "PATCH",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({
guardrail_level: "strict",
guardrail_fallback_line: "I can only help with questions about your account.",
guardrail_blocked_words: ["competitor name", "refund guarantee"],
}),
});
Changing these fields does not regenerate the system prompt. guardrail_blocked_words
replaces the whole list; send [] to clear it.
Attaching knowledge
Avatars answer from their prompt plus the documents uploaded or attached to them. A document left unattached in your account's knowledge bank is used by no avatar. Uploading to an avatar attaches the document to it alone:
- cURL
- Python
- Node.js
curl -s "https://backend.goldenengine.ai/v1/avatars/$AVATAR_ID/knowledge" \
-H "X-Api-Key: $GOLDENENGINE_API_KEY" \
with open("handbook.pdf", "rb") as document:
requests.post(
f"{BASE}/v1/avatars/{avatar_id}/knowledge",
headers=HEADERS,
files={"file": document},
)
import { readFile } from "node:fs/promises";
const form = new FormData();
form.set(
"file",
new Blob([await readFile("handbook.pdf")], { type: "application/pdf" }),
"handbook.pdf",
);
await fetch(`${BASE}/v1/avatars/${avatarId}/knowledge`, {
method: "POST",
headers,
body: form,
});
GET /v1/avatars/{avatar_id}/knowledge lists what is attached, and
DELETE /v1/avatars/{avatar_id}/knowledge/{knowledge_id} deletes a document outright — it
does not return it to the bank. See Knowledge bank for how
scoping and retrieval work, and Memory for what an avatar keeps
from past conversations.
Preloading
The first conversation with an avatar that is not already loaded on the engine waits a few
seconds while it cold-loads. POST /v1/avatars/{avatar_id}/preload starts that load early
and returns 202; call it as soon as you know a session is coming, such as when a user opens
the page. Then poll GET /v1/avatars/{avatar_id}/preload-status and connect once status is
ready:
status | Meaning |
|---|---|
ready | Loaded — connect now |
loading | Load in progress; keep polling |
cold or error | Not loaded; send the preload request again |
unknown | The engine could not be reached; keep polling |
Both endpoints return 409 for an avatar that is not ready, and work on stock avatars as
well as your own. Preloading is best-effort: if it fails, the conversation cold-loads as it
would have anyway.