Quickstart
Create a key, pick a stock avatar, and start your first conversation.
By the end of this page you will have an API key that works, a stock avatar chosen, and a conversation created against it.
The examples call https://backend.goldenengine.ai, which is the API host for every
environment. It is also written into the API reference, so the
playground there sends requests to the same place these snippets do.
Each example reads the key from GOLDENENGINE_API_KEY, so set it once and the snippets
below run as written:
export GOLDENENGINE_API_KEY="<YOUR_API_KEY>"
Create an API key
In the Golden Engine dashboard, open API and create a key. The full secret is shown once — copy it now, because it cannot be retrieved later.
Confirm it works:
- cURL
- Python
- Node.js
cURLcurl -s "https://backend.goldenengine.ai/v1/me" \-H "X-Api-Key: $GOLDENENGINE_API_KEY"Pythonimport osimport requestsBASE = "https://backend.goldenengine.ai"HEADERS = {"X-Api-Key": os.environ["GOLDENENGINE_API_KEY"]}print(requests.get(f"{BASE}/v1/me", headers=HEADERS).json())Node.jsconst BASE = "https://backend.goldenengine.ai";const headers = { "X-Api-Key": process.env.GOLDENENGINE_API_KEY };console.log(await (await fetch(`${BASE}/v1/me`, { headers })).json());{"user_id": "9c4e8d21-6f3a-4b8e-9d21-1f2a3b4c5d6e",}A
401with"code": "invalid_api_key"means the key is wrong or revoked.Pick a stock avatar
Stock avatars are trained and ready, so you can skip training entirely.
- cURL
- Python
- Node.js
cURLcurl -s "https://backend.goldenengine.ai/v1/avatars/stock?limit=5" \-H "X-Api-Key: $GOLDENENGINE_API_KEY"Pythonavatars = requests.get(f"{BASE}/v1/avatars/stock",headers=HEADERS,params={"limit": 5},).json()# The list is not filtered by status — take the first one that is ready.avatar_id = next(a["id"] for a in avatars["items"] if a["status"] == "ready")Node.jsconst avatars = await (await fetch(`${BASE}/v1/avatars/stock?limit=5`, { headers })).json();// The list is not filtered by status — take the first one that is ready.const avatarId = avatars.items.find((a) => a.status === "ready").id;The response is a page —
{ items, total, skip, limit }. The list is not filtered by status, so take theidof an avatar whosestatusis"ready"— any other status makes the next step return404:export AVATAR_ID="<id from the response>"To use an avatar of your own instead, list yours with
GET /v1/avatars— only avatars whose status isreadycan hold a conversation. See Avatars for the training path.Start a conversation
- cURL
- Python
- Node.js
cURLcurl -s "https://backend.goldenengine.ai/v1/conversations" \-H "X-Api-Key: $GOLDENENGINE_API_KEY" \-H "Content-Type: application/json" \-d '{"avatar_id": "'"$AVATAR_ID"'","title": "My first conversation","greeting": "Hi there, how can I help?"}'Pythonconversation = requests.post(f"{BASE}/v1/conversations",headers=HEADERS,json={"avatar_id": avatar_id,"title": "My first conversation","greeting": "Hi there, how can I help?",},).json()Node.jsconst conversation = await (await fetch(`${BASE}/v1/conversations`, {method: "POST",headers: { ...headers, "Content-Type": "application/json" },body: JSON.stringify({avatar_id: avatarId,title: "My first conversation",greeting: "Hi there, how can I help?",}),})).json();{"conversation_id": "3f8b1c02-7d4e-4a19-b0c3-5e6f7a8b9c0d","end_user_id": "anon:3f8b1c02-7d4e-4a19-b0c3-5e6f7a8b9c0d","conversation_url": "https://www.goldenengine.ai/embed/c/3f8b1c02-7d4e-4a19-b0c3-5e6f7a8b9c0d?token=eyJhbGci...","status": "active","expires_at": "2026-08-17T16:42:00Z"}The token inside
conversation_urlis valid for 60 minutes.expires_attells you when it lapses; create another conversation to get a fresh one.end_user_idis the conversation's memory scope. You sent none, so this session keeps its memory to itself. When you build for real, pass a stable ID per person so the avatar remembers them — see Memory and end users, and Memory for reading back or deleting what it learned.Read it back
The conversation is a durable record you can query, close, and pull a transcript from:
- cURL
- Python
- Node.js
cURLexport CONVERSATION_ID="<conversation_id from the response>"curl -s "https://backend.goldenengine.ai/v1/conversations/$CONVERSATION_ID" \-H "X-Api-Key: $GOLDENENGINE_API_KEY"# Closing also queues memory compaction.curl -s -X PATCH "https://backend.goldenengine.ai/v1/conversations/$CONVERSATION_ID" \-H "X-Api-Key: $GOLDENENGINE_API_KEY"Pythoncid = conversation["conversation_id"]print(requests.get(f"{BASE}/v1/conversations/{cid}", headers=HEADERS).json())# Closing also queues memory compaction.print(requests.patch(f"{BASE}/v1/conversations/{cid}", headers=HEADERS).json())Node.jsconst cid = conversation.conversation_id;console.log(await (await fetch(`${BASE}/v1/conversations/${cid}`, { headers })).json());// Closing also queues memory compaction.console.log(await (await fetch(`${BASE}/v1/conversations/${cid}`, { method: "PATCH", headers })).json(),);Embed it in your page
conversation_urlfrom step 3 is a complete, embeddable page. Drop it in an iframe and the session runs there — no client library, no WebSocket handling of your own:<iframesrc="PASTE_CONVERSATION_URL_HERE"allow="microphone; camera; autoplay"style="width: 100%; height: 600px; border: 0"></iframe>microphoneis required — without it the avatar cannot hear anything, and the visitor sees a "Microphone Required" screen instead of a session.camerais there because the embed turns the camera on when the visitor presses Start and sends the avatar a frame about every 10 seconds; leave it out and the camera fails while the voice session carries on. Mint the URL server-side when a visitor is about to start: it carries a session token that expires in 60 minutes, so it cannot be baked into a page you cache.See Embed an avatar for the full flow, including closing the session and reading the transcript back.