Base URL
application/json unless otherwise noted.
Authentication
Every request must include anX-API-Key header. Create keys in the Developer Portal.
Two-tier authentication model
TruGen uses two credentials, each with a different purpose:
See JS SDK Authentication or Python SDK Authentication for the full pattern.
Resource model
The API is organized around a small set of resources:Common patterns
Create an agent → embed it
POST /v1/ext/agent: create the agent, get anagent_id- Drop the widget or iframe with that ID
- Users interact: sessions are automatically tracked
Personalize per user
- Create an agent once with the shared prompt
- On each session, mint a session token with
userId,userName, andcontext - The agent sees this context and personalizes accordingly
Use a template across many agents
POST /v1/ext/template: create the template with the shared configPOST /v1/ext/agentbytemplate: spin up a new agent from the template
Access session results
- Handle the
call_endedwebhook: see Event Callbacks - Fetch the conversation record with
GET /v1/ext/conversation/{id}: includeschat_history,snippets,feedback,usage_json
Errors
Errors are returned as JSON with anerror field:
Pagination
List endpoints useoffset + perpage query parameters:
X-Total-Count header with the total match count for the query.
Additional filters vary per endpoint: check the individual endpoint page.
Versioning
The API is versioned in the URL path (/v1/…, /v2/…). Breaking changes ship as new versions. Non-breaking additions ship in place; watch the changelog for notice.
Documentation map
Video Agents
Create, fetch, update, and delete conversational agents.
Templates
Reusable persona blueprints.
Knowledge Base
Ground answers in your documents and URLs.
Conversations
Session records, transcripts, and speak commands.
Tools
Register callable actions for agents.
Guardrails
Safety-check rules agents can call mid-conversation.
Providers
List available STT, LLM, and TTS providers.
Avatars
Browse stock and custom avatars.
Text to Video
Async video generation from a script.
Quick links
- JS SDK Authentication: client-safe token exchange
- Callbacks: real-time event webhooks