# Trillet AI - Complete Documentation > This file contains the complete documentation for Trillet AI. > Total pages: 140 --- ## Introduction *Starter project with example pages, components, and auto-deploy from GitHub. Edit MDX files, customize your theme, and go live in minutes.* Welcome to your documentation site. This starter project has everything you need to get up and running. ## What's included Example pages showing how to structure your docs with headings, lists, and components. Cards, callouts, tabs, steps, and more — all ready to use. Push to GitHub and your docs build and deploy automatically. Change colors, logo, navigation, and theme in `docs.json`. ## Next steps Learn how to edit pages, customize your site, and deploy changes. --- ## Connect Trillet over MCP *Build and operate Trillet voice agents from Claude, Cursor, and any other MCP client.* Trillet ships an official [Model Context Protocol](https://modelcontextprotocol.io) server. Point an MCP client at it and your assistant can build agents, write call flows, wire in-call API tools, attach knowledge bases, buy and bind phone numbers, run workflows, and read real call transcripts — without you leaving the chat. The server exposes **77 tools**. Every tool is annotated read-only or destructive, and the destructive ones refuse to run without an explicit `confirm: true`. The MCP server is a wrapper around the same public API documented in the [API Reference](/v1/api-reference/introduction). Anything the server can do, your API key can already do. ## Before you start You need two values from your Trillet workspace. **Settings → Developer → API Keys.** Create a key and copy it — it is shown once. **Settings → Workspace → Workspace Details.** A 24-character hex id, with one-click copy. It is also under **Copy workspace ID** in the sidebar workspace switcher. No **API Keys** entry under **Developer**? It is hidden on SMB plans, and on every other plan it needs the `api_keys:view` permission. Ask a workspace owner to issue a key for you, or to grant you the permission. Your API key is a secret with full access to the workspace. Keep it out of shared chats, screenshots, and source control. You can revoke and reissue a key at any time from the same settings page. ## Choose a route There are two ways to connect. They expose the same tools. | | Hosted server | Local (stdio) | |---|---|---| | **How** | Your client connects to `https://mcp.trillet.ai/mcp` | Your client runs `npx -y @trillet-ai/mcp` on your machine | | **Needs** | A client that supports remote MCP **and custom headers** | Node.js 18+ | | **Good for** | Claude Code, and anything that speaks streamable HTTP | Claude Desktop, Cursor, and any stdio client | | **Updates** | Always current | Pulled on each launch with `@latest` | If your client supports remote MCP servers with custom headers, use the hosted server. Otherwise use the local route — it is not a lesser option, just a different transport. ## Hosted server ``` POST https://mcp.trillet.ai/mcp ``` Streamable HTTP, MCP protocol revision `2025-06-18`. Authentication is two headers: `Bearer ` The 24-character workspace id the session should act on. This differs from the REST API, which uses an `x-api-key` header. The MCP endpoint uses `Authorization: Bearer` because that is what MCP clients send. If your client lets you set a URL but only **one** header, you can pass the workspace id as a query parameter instead: ``` https://mcp.trillet.ai/mcp?workspace= ``` The workspace id is not a secret, so it is safe in a URL. The API key is accepted **only** in the `Authorization` header — never in the query string — so it stays out of browser history and server logs. ### Claude Code ```bash claude mcp add --transport http trillet https://mcp.trillet.ai/mcp \ --header "Authorization: Bearer YOUR_API_KEY" \ --header "X-Trillet-Workspace-Id: YOUR_WORKSPACE_ID" ``` Then confirm it is live: ```bash claude mcp list ``` ### Any HTTP client A raw request, to verify connectivity or to wire up a client we have not documented: ```bash curl -X POST https://mcp.trillet.ai/mcp \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Trillet-Workspace-Id: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "my-client", "version": "1.0.0" } } }' ``` A successful response carries an `Mcp-Session-Id` header. Send it on every subsequent request. ## Local server (stdio) The same server, published on npm as [`@trillet-ai/mcp`](https://www.npmjs.com/package/@trillet-ai/mcp). It reads both credentials from environment variables and talks to the Trillet API directly. ### Claude Desktop Open **Settings → Developer → Edit Config** and add: ```json { "mcpServers": { "trillet": { "command": "npx", "args": ["-y", "@trillet-ai/mcp@latest"], "env": { "TRILLET_API_KEY": "YOUR_API_KEY", "TRILLET_WORKSPACE_ID": "YOUR_WORKSPACE_ID" } } } } ``` Restart Claude Desktop. Trillet appears in the tools menu. ### Cursor Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per project): ```json { "mcpServers": { "trillet": { "command": "npx", "args": ["-y", "@trillet-ai/mcp@latest"], "env": { "TRILLET_API_KEY": "YOUR_API_KEY", "TRILLET_WORKSPACE_ID": "YOUR_WORKSPACE_ID" } } } } ``` ### Claude Code ```bash claude mcp add trillet \ -e TRILLET_API_KEY=YOUR_API_KEY \ -e TRILLET_WORKSPACE_ID=YOUR_WORKSPACE_ID \ -- npx -y @trillet-ai/mcp@latest ``` ### Other clients Any stdio MCP client works. The command is: ```bash TRILLET_API_KEY=YOUR_API_KEY \ TRILLET_WORKSPACE_ID=YOUR_WORKSPACE_ID \ npx -y @trillet-ai/mcp@latest ``` Optional: set `TRILLET_API_URL` to override the API base (defaults to `https://api.trillet.ai`). ## ChatGPT and the connector directories **Trillet is not currently installable from the ChatGPT connector UI, the Claude connector directory, or any other one-click MCP directory.** Those surfaces discover and authorise a server through OAuth. The Trillet MCP server authenticates with a static API key and does not implement OAuth — there is no `/.well-known/oauth-protected-resource` or `/.well-known/oauth-authorization-server` endpoint to discover, so the directories have nothing to connect to. In practice: - **ChatGPT** — not supported today. The connector dialog has no field for a custom header, so the workspace id cannot be supplied. Even with the `?workspace=` query parameter above, whether you can set a bearer token at all depends on your ChatGPT release. We do not recommend this path. - **Claude connector directory** — Trillet is not listed. Use the Claude Code or Claude Desktop setup above instead; both are fully supported. - **Everything else** — if the client can set custom headers, the hosted endpoint works. If it can run a command, the stdio package works. OAuth support is on the roadmap and is what unlocks one-click install in the directories. If that matters to your team, tell us — demand is how we prioritise it. ## Agencies and multiple workspaces Every tool accepts an optional `workspace_id` argument that overrides the connection's default workspace for that one call. One connection can therefore operate across several client workspaces, as long as your API key's user is a member of each. Ask your assistant to "list the agents in workspace ``" and it will pass the override through. ## What you can do ### Agents and voices (6 tools) `trillet_list_agents`, `trillet_get_agent`, `trillet_create_agent`, `trillet_update_agent`, `trillet_delete_agent`, `trillet_search_voices` ### Call flows (13 tools) `trillet_list_call_flows`, `trillet_get_call_flow`, `trillet_create_call_flow`, `trillet_update_call_flow`, `trillet_update_prompt`, `trillet_set_incall_api_tools`, `trillet_set_post_call_analysis`, `trillet_list_drafts`, `trillet_deactivate_drafts`, `trillet_publish_draft`, `trillet_duplicate_call_flow`, `trillet_archive_call_flow`, `trillet_delete_call_flow` ### Flow settings (8 tools) `trillet_set_transfers`, `trillet_set_office_hours`, `trillet_set_call_settings`, `trillet_set_speech_settings`, `trillet_set_welcome_message`, `trillet_set_code_actions`, `trillet_set_background_audio`, `trillet_set_security_settings` ### Node flows (10 tools) `trillet_node_flow_reference`, `trillet_list_node_flows`, `trillet_get_node_flow`, `trillet_create_node_flow`, `trillet_list_node_flow_templates`, `trillet_update_node_graph`, `trillet_validate_node_graph`, `trillet_publish_node_graph`, `trillet_simulate_node_graph`, `trillet_list_node_flow_runs` ### Phone numbers (8 tools) `trillet_list_phone_numbers`, `trillet_search_available_numbers`, `trillet_purchase_phone_number`, `trillet_bind_phone_number`, `trillet_release_phone_number`, `trillet_get_phone_number_config`, `trillet_update_phone_number_config`, `trillet_register_external_number` ### Knowledge bases (7 tools) `trillet_list_knowledge_bases`, `trillet_get_knowledge_base`, `trillet_create_knowledge_base`, `trillet_add_kb_text`, `trillet_upload_kb_file`, `trillet_attach_knowledge_bases`, `trillet_delete_knowledge_base` ### Workflows (12 tools) `trillet_workflow_reference`, `trillet_list_workflows`, `trillet_get_workflow`, `trillet_create_workflow`, `trillet_update_workflow`, `trillet_activate_workflow`, `trillet_pause_workflow`, `trillet_delete_workflow`, `trillet_test_workflow`, `trillet_run_workflow`, `trillet_list_workflow_runs`, `trillet_get_workflow_run` ### Calls (5 tools) `trillet_list_calls`, `trillet_get_call_metrics`, `trillet_get_call`, `trillet_review_calls`, `trillet_start_outbound_call` ### Text calls (3 tools) `trillet_start_text_call`, `trillet_say`, `trillet_end_text_call` ### Secrets (3 tools) `trillet_list_secrets` (always masked), `trillet_set_secret`, `trillet_delete_secret` ### Account (2 tools) `trillet_get_usage`, `trillet_list_transactions` ### Tools that cost money or change the world These are annotated destructive and will not run unless the call includes `confirm: true`, so your assistant has to ask you first: `trillet_start_outbound_call` (places a real call) · `trillet_purchase_phone_number` (bills the workspace) · `trillet_run_workflow` (real run, real side effects) · `trillet_register_external_number` · and every delete tool. ## Troubleshooting ### The client says connected, but every tool fails with 401 Connecting does not validate your credentials — the handshake succeeds even with a wrong API key, and the failure only appears on the first real tool call. To actually confirm a connection, ask your assistant to list your agents. If you see `Unauthorized Api Key`, either the key is wrong or the key's user is not a member of the workspace id you supplied. Re-copy both values from the settings pages above. ### Missing Trillet API key The `Authorization` header is absent or malformed. It must read `Authorization: Bearer ` — the word `Bearer`, a single space, then the key. ### Missing Trillet workspace The `X-Trillet-Workspace-Id` header is absent. Add it, or append `?workspace=` to the endpoint URL if your client cannot set a second header. ### My changes are not taking effect on test calls This is almost always an active editor draft. Drafts override production for dashboard test calls. Ask your assistant to check `trillet_get_call_flow` — it reports `has_active_draft` — then either publish the draft or run `trillet_deactivate_drafts` to return the flow to production. ### The agent greets the caller twice The greeting is scripted in the prompt as well as set as the welcome message. The platform already plays the welcome message, so remove the opening line from the prompt. ### npx cannot find the package You need Node.js 18 or later. Check with `node --version`, then run `npx -y @trillet-ai/mcp@latest` directly in a terminal to see the real error. ## Security - The API key and workspace id are read from headers or environment variables and are never logged. - The API key is never accepted in a URL, so it cannot leak through browser history, referrers, or access logs. - `trillet_list_secrets` always returns masked values. - Tools with real-world or irreversible effects are annotated destructive and gated behind `confirm: true`. - Revoke a key at any time from **Settings → Developer → API Keys**. Revocation takes effect immediately on both routes. ## Getting help Ask in the Trillet community — the fastest way to get an answer. Every endpoint the MCP server calls under the hood. --- ## Quickstart *Edit MDX files, add new pages to your navigation, customize colors and branding in docs.json, and preview locally with the Jamdesk CLI.* Your docs are built from MDX files in this repository. Every push to GitHub triggers an automatic build and deploy. ## Edit a page Open any `.mdx` file and start writing. MDX supports standard Markdown plus Jamdesk components. ```mdx --- title: My Page description: A brief description for SEO --- # Heading Regular markdown works — **bold**, *italic*, `code`, [links](https://example.com). ``` ## Add a new page ### 1. Create an MDX file Add a new `.mdx` file anywhere in your project, for example `guides/deployment.mdx`. ### 2. Add it to navigation Open `docs.json` and add the page path to the `navigation` section: ```json { "group": "Guides", "pages": ["guides/deployment"] } ``` ### 3. Push to GitHub Commit and push. Your site will rebuild automatically. ## Customize your site Everything is configured in `docs.json`: | Setting | What it does | |---------|-------------| | `name` | Site name shown in the header | | `colors` | Primary, light, and dark accent colors | | `logo` | Light and dark mode logo images | | `theme` | Visual theme (`jam`, `nebula`, or `pulsar`) | | `navigation` | Sidebar tabs, groups, and page order | | `navbar` | Top navigation links and buttons | See the full configuration reference at [jamdesk.com/docs](https://jamdesk.com/docs). ## Use the CLI Install the Jamdesk CLI for local development: ```bash npm install -g jamdesk ``` Preview your docs locally: ```bash jamdesk dev ``` This starts a local server with hot reload so you can see changes instantly. --- ## Callouts *Draw attention to important information with Note, Tip, Warning, Danger, and Check callouts. Supports custom titles and rich Markdown content.* Callouts draw attention to key information. ## Types Helpful context or additional information. Best practices or optimization suggestions. Important caveats or requirements. Critical warnings — actions that could cause data loss. Success confirmations or completed steps. ## Usage ```mdx Helpful context or additional information. Important caveats or requirements. ``` ## With custom title You can use **Markdown** inside callouts, including `code` and [links](/introduction). ```mdx You can use **Markdown** inside callouts. ``` --- ## Cards *Create linked feature grids and navigation panels with Card and Columns components. Supports icons, descriptions, and click-through links.* ## Basic card A simple card with a title and content. ```mdx A simple card with a title and content. ``` ## Card with icon Add an icon for visual emphasis. ```mdx Add an icon for visual emphasis. ``` ## Card with link Cards can link to other pages. ```mdx Cards can link to other pages. ``` ## Card group Use `Columns` to arrange cards in a grid: Documentation API Reference Tutorials Get help ```mdx Documentation API Reference ``` ## Properties The title displayed at the top of the card. Font Awesome icon name (e.g., "book", "code", "rocket"). URL the card links to. --- ## Steps *Break multi-step processes into numbered instructions with Steps and Step components. Each step gets a title and supports rich content.* Use Steps for ordered instructions: ### 1. Install the CLI ```bash npm install -g jamdesk ``` ### 2. Initialize your project ```bash jamdesk init ``` ### 3. Start writing Open your project and create `.mdx` files. Each file becomes a page in your docs. ## Usage ```mdx Description of what to do. Next instruction. ``` Steps work well for setup guides, tutorials, and getting-started flows. --- ## Tabs & Accordions *Organize content with Tabs for language or platform variants and AccordionGroup for collapsible FAQ-style sections that save vertical space.* ## Tabs Show content in switchable panels: ### React ```jsx function App() { return

Hello React

; } ``` ### Vue ```html ``` ### Svelte ```html

Hello Svelte

``` ```mdx Content for the React tab. Content for the Vue tab. ``` ## Accordions Collapsible sections for optional details: ### What is Jamdesk? Jamdesk is a documentation platform that builds and hosts your docs from MDX files in a GitHub repository. ### How do I deploy? Push to GitHub. Jamdesk builds and deploys automatically on every push. ### Can I use a custom domain? Yes. Configure your custom domain in the Jamdesk dashboard under project settings. ```mdx Answer here. ``` --- ## Trillet Change Log *View the latest changes to Trillet* --- ## API Best Practices *Guidelines for integrating with Trillet AI API* ## Authentication ### API Keys - Keep your API keys secure and never expose them in client-side code - Use different API keys for development and production - Rotate your API keys periodically - Monitor your API key usage for suspicious activity ```bash # API Key format xxxxxxxxxxxxxxxxxxx ``` ## Error Handling Implement proper error handling for API responses: ```bash curl -X POST https://api.trillet.ai/v1/api/call \ -H "x-api-key: YOUR_API_KEY" \ -H "x-workspace-id: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -d '{ "call_agent_id": "agent_123", "to": "+1234567890" }' ``` Common error responses: ```json { "error": { "code": "insufficient_credits", "message": "Your account has insufficient credits" } } ``` ```json { "error": { "code": "invalid_number", "message": "The provided phone number is invalid" } } ``` ## Rate Limits - Production API keys are limited to 60 requests per minute - Implement backoff when you hit rate limits - Monitor your API usage in the dashboard Rate limit response: ```json { "error": { "code": "rate_limit_exceeded", "message": "Too many requests. Please try again in 60 seconds.", "reset_at": "2024-01-22T15:30:00Z" } } ``` ## Production Checklist 1. **Authentication** - Use production API keys - Implement key rotation - Secure key storage 2. **Error Handling** - Handle all error codes - Implement retry logic - Log errors appropriately 3. **Monitoring** - Track API response times - Monitor error rates - Set up alerts ## Need Help? Check our API status and uptime Get technical support --- ## Webhook Integration Guide [Coming Soon] ## Introduction This guide will help you integrate and set up webhooks for inbound AI-powered calls. It explains how to configure webhook settings, set up an API receiver, and dynamically replace variables in AI-generated prompts. ## Prerequisites Before you begin, make sure you have: - An account for your application. - A valid URL to handle webhook calls. ## Configure Webhook Settings To get started, set up your webhook URL, headers, and query parameters. - Enter your webhook URL - Add your API authentication details, such as bearer tokens or API keys. - Include any dynamic parameters you wish to pass, such as customer_name and order_status. ![title](/images/Inboundwebhook.png) ## Create an API Receiver - Create an API endpoint to process incoming webhook requests. ```bash app.get('/get-webhook', (req, res) => { console.log("Request Headers: ", req.headers); console.log("Request Query: ", req.query); // Respond with variables for AI prompt res.status(200).json({ variables: { customer_name: "John Doe", order_status: "shipped" } }); }); ``` Note: The API response should always include the variables object in the following format: ```bash { "variables": { "customer_name": "John Doe", "order_status": "shipped" } } ``` ## Replace Variable in AI Prompts Use the returned variables from your webhook to dynamically update AI prompts. Example Prompt in Call Flow Designer: ```bash Hello, {{customer_name}}, your order status is {{order_status}}. ``` When the webhook processes the request, variables are replaced dynamically: ```bash Hello, John Doe, your order status is shipped. ``` --- ## Introduction ![Trillet Logo](/logo/Trillet-logo-light.svg =200x) ## Transform Customer Interactions with AI Trillet AI provides a powerful REST API to create human-like voice and messaging experiences at scale. Our platform combines state-of-the-art language models with advanced voice synthesis to enable natural conversations across multiple channels. Set up your first agent in minutes! Explore our comprehensive API documentation ## Core Features Create and manage conversational call agents with unique voices and personalities through our REST API Create knowledge bases and add text or files Design and control call & conversation flows programmatically Design and control call & conversation flows programmatically Initiate and manage voice calls via REST endpoints Design and control customer interactions through conversations programmatically ## Getting Started 1. Sign up for an API key at [app.trillet.ai](https://app.trillet.ai) 2. Follow our [Quick Start Guide](/documentation/quickstart) to make your first API call 3. Explore our [API Reference](/v1/api-reference/introduction) for detailed endpoint documentation ## Resources Complete API reference API integration guidelines Get technical help --- ## On-Premise Deployment ## On-Premise Deployment: Run Trillet in Your Own Infrastructure Trillet is now available for on-premise deployment. For enterprises that need complete control over where their data lives, you can run our full voice AI platform within your own infrastructure. **Trillet is the only voice AI orchestration and application platform in Australia offering on-premise deployment.** ## Why On-Premise? ### Data Sovereignty Customer conversations never leave your controlled environment. For Australian companies operating under strict regulatory requirements, this simplifies compliance and gives your security team full visibility over where sensitive data resides. ### Privacy Voice interactions contain highly personal information. On-premise deployment ensures that customer calls, account details, and sensitive data stay within your perimeter, not traversing third-party networks. ### Compliance Whether you're navigating APRA CPS 234, HIPAA, or internal security policies, on-premise deployment provides the audit trail and control you need to satisfy regulators and stakeholders. ### Performance Running locally eliminates network latency to external providers, delivering faster response times for your customers. ## What's Included Trillet ships as a Docker container that includes our complete platform: the orchestration layer, API management, and management UI. You're not just getting an inference engine, you're getting the full application. **Bring your own providers.** Trillet orchestrates your choice of TTS, LLM, and telephony components, including on-premise models from providers that offer them. You control the stack. ## Who It's For On-premise deployment is designed for Australian enterprises with strict data sovereignty requirements. If your security policies require that customer voice data stays within infrastructure you control, or if you operate in regulated industries where compliance demands are high, on-premise is for you. ## Still Fully Managed On-premise doesn't mean DIY. Our team handles deployment, configuration, updates, and ongoing support. You get the compliance posture of on-premise with the operational simplicity of a managed service. ## Get Started To discuss on-premise deployment for your organisation, [contact our sales team](https://cal.com/forms/1feb42e7-a4b2-4cd3-8076-18ea016b1a2f). --- ## documentation/platform-integrations ## Trillet AI Integrations Trillet AI offers seamless integration with popular automation tools like **Make.com**, **n8n**, and our **Web SDK**, allowing you to automate **outbound AI voice calls** and embed **AI agents directly into your applications**. Use these platforms and tools to trigger TrilletAI's call capabilities directly from your workflows or integrate voice agents into your websites. --- ## Make.com Integration Hero Dark Hero Light Integrate Trillet AI with Make.com **custom node** to automate **outbound voice call workflows**. This is ideal for building call-based campaigns, customer notifications, or voice follow-ups powered by Trillet AI. ### Installation To add TrilletAI's app to your Make.com organization: You can find TrilletAI directly on Make.com by searching **"TrilletAI"** in the App list under the `us1` or `us2` regions. If TrilletAI does not appear in your region or account, use the invitation link below to add it manually: 🔗 **[Click here to install](https://www.make.com/en/hq/app-invitation/380f3212527664bd958eb3bf383c97fe)** if it doesn't appear. ## n8n Integration Hero Dark Hero Light TrilletAI provides a **custom node** for [n8n](https://n8n.io) to let you trigger **outbound voice calls** directly within your workflows. This allows you to automate call-based sequences based on custom events, user actions, or external system triggers. ### Installation Steps 1. Ensure `n8n` is installed on your machine. If not, follow [n8n installation guide](https://docs.n8n.io/). 2. Open your terminal and install the TrilletAI node package: ```bash npm install n8n-trillet-nodes ``` --- ## SDK Integration Hero Dark Hero Light The Trillet AI Web SDK allows you to integrate **AI-powered voice agents** directly into your website or web application. This enables users to interact with your Trillet AI agents via voice or text calls, ideal for embedding real-time AI conversations in client-facing apps, demos, or custom workflows. The SDK handles real-time audio and supports features like transcription, audio analysis, and event emitting. ### Installation You can install the SDK via npm for modern web frameworks (e.g., React, Next.js) or load it directly from a CDN for simple HTML integrations. #### Via npm 1. Install the package: ```bash npm install @trillet-ai/web-sdk ``` 2. Import and use in your code: ```typescript import { TrilletAgent } from '@trillet-ai/web-sdk'; ``` #### Via CDN (No Build Tools Required) Include the SDK script in your HTML: ```html ``` **Note:** The SDK requires a browser environment with secure context (HTTPS or localhost). It does not support server-side rendering. ### Configuration Initialize a `TrilletAgent` instance: ```typescript const agent = new TrilletAgent({ workspaceId: 'your-workspace-id', agentId: 'your-agent-id', variables: { key: 'value' }, mode: 'voice', }); ``` ### Usage 1. **Start a Call:** - Use `startPublicCall()` for public (workspace-based) integrations. - Use `startCall()` for API key authenticated calls. ```typescript try { await agent.startPublicCall(); console.log('Call started'); } catch (error) { console.error('Failed to start call:', error); } ``` 2. **End a Call:** ```typescript agent.endCall(); ``` 3. **Toggle Microphone:** ```typescript agent.toggleMicrophone(true); // Enable microphone ``` 4. **Event Handling:** The SDK extends `EventEmitter`. Listen for events like `connected`, `disconnected`, `error`, `assistantStartedSpeaking`, etc. ```typescript agent.on('connected', (details) => { console.log('Connected:', details.callId, details.agent.name); }); agent.on('disconnected', () => { console.log('Call ended'); }); agent.on('error', (error) => { console.error('Error:', error); }); ``` 5. **Transcripts:** Access real-time and final transcripts: ```typescript const transcripts = agent.getTranscripts(); // Array of Transcript objects const current = agent.getCurrentTranscript(); // Partial transcripts ``` ### SDK Integration Preview Trillet AI SDK Integration **Important:** Make sure to enable public access in your call flow settings before testing the SDK integration. You can find this option in the call flow settings panel. ### Examples #### React Component Integration For React/Next.js apps, create a basic component to handle calls: ```tsx import { useState, useRef } from 'react'; import { TrilletAgent } from '@trillet-ai/web-sdk'; const VoiceAgent = ({ agentId, workspaceId }) => { const agentRef = useRef(null); const [isCallActive, setIsCallActive] = useState(false); if (!agentRef.current) { agentRef.current = new TrilletAgent({ workspaceId, agentId, }); } const startCall = async () => { try { await agentRef.current.startPublicCall(); setIsCallActive(true); } catch (error) { console.error('Failed to start call:', error); } }; const endCall = () => { agentRef.current.endCall(); setIsCallActive(false); }; return ( ); }; export default VoiceAgent; ``` #### Simple HTML Button Integration Embed a button that starts/stops a voice call with your agent: ```html ``` **Note:** Replace placeholders like `your-workspace-id` and `your-agent-id` with your actual Trillet AI credentials. For production, secure sensitive data (e.g., avoid exposing API keys client-side). The SDK handles browser compatibility checks internally. If you encounter issues, ensure microphone permissions are granted and test in a secure context. --- ## Quickstart Guide *Complete guide to setting up your first AI agent in Trillet - from creating call flows to handling live calls* This handbook walks you through setting up your first AI agent in Trillet. From creating call flows to assigning numbers and handling live calls, you'll learn each step to get your agent running smoothly. **Ready to scale beyond the basics?** Our platform supports complete white-label customization - imagine your own branded domain, custom email notifications, and workspaces that reflect your unique brand identity. Perfect for agencies and enterprises looking to offer AI voice solutions under their own name. [Explore Whitelabel](https://app.trillet.ai/settings) to unlock unlimited branding possibilities. Looking for advanced whitelabel features? Our [Exclusive Whitelabel Guide](https://app.trillet.ai/) contains premium strategies and configurations - available exclusively to Whitelabel subscribers. ## Getting Started Once you sign in, you'll land on your Home Page. To build an AI agent, the first step is creating a Call Flow. 1. **Access the Side Panel**: Hover over and click the Trillet logo. This will open the Side Panel. Sidebar Interface Sidebar Interface 2. **Navigate the Interface**: From the Side Panel, you can navigate to all sections of the Trillet interface. Each section has its own functionality, which we'll explore as we move through this handbook. 3. **Start with Flow Studio**: - In the Side Panel, click **Flow Studio** - This will open a dropdown menu with two options: [Call Flows](/v1/api-reference/endpoints/flows/call-flows/create) and [Message Flows](/v1/api-reference/endpoints/flows/message-flows/create) 4. **Choose Your Flow Type**: Trillet lets you create both, depending on your use case. In this module, we'll start with a Call Flow. ### Understanding Call Flows A Call Flow is the backbone of your AI agent. It defines how conversations are structured and whether your agent will handle one-way or two-way communication. You can think of it like a blueprint for your agent's calls. After navigating to Call Flows, your dashboard will look like this: Call Flows Dashboard Call Flows Dashboard - As you create call flows, they'll appear here for quick access - You can also add personal folders to keep your work organized To begin building your first flow, click the **Create New Flow** button. ## 1.1 Create a Call Flow from Scratch Trillet gives you the ability to customize your agent and choose how it communicates with users. On this page, you'll set the foundation for your AI agent by giving it a name, defining its purpose, and selecting the right call direction, voice, and language model. Think of this as your agent's "identity card" - the details you set here define how it looks, sounds, and behaves during conversations. Call Flow Creation Interface Call Flow Creation Interface ### Configuration Steps **Select Folder** - Choose the folder where you want to save this call flow - Organizing flows into folders helps keep your workspace tidy **Enter Flow Information** - **Flow Title**: Give your call flow a descriptive name (e.g., Sales Demo Flow) - **Description**: Add a short explanation of what this flow is for (optional, but useful if you have multiple flows) - **Call Direction**: - **Outbound Only**: one-way outgoing calls without return calls - **Outbound & Inbound**: two-way conversations where the agent can also receive calls Select the option that matches your use case. **Configure Your Agent** - **Agent Name**: Assign a name to your agent. This is how it will appear across your workspace - **Language Model**: Select the AI model that powers your agent's responses (see [Call Agents API](/v1/api-reference/endpoints/agents/call/create) for available models) - **Voice Options**: Choose from available voices: - Trillet AI Voices (default, included) - ElevenLabs Voices (premium, additional cost) - BYO ElevenLabs (bring your own ElevenLabs account) [You will need to ensure that you have added the voices to your ElevenLabs account first under 'My Voices' and that the necessary privileges are provided to the API key.] - **Flow Generator**: Trillet gives you the ability to turn an existing call recording into a ready-to-use call flow Once you've filled in the details, click **Next** (bottom right) to move on to prompting your agent. ## 1.2 Prompting Your Agent The way you prompt your agent determines how well it performs during conversations. Think of it like giving instructions to a teammate before they step into a meeting - the clearer and more specific you are, the better they'll handle the interaction. You can also choose how your agent starts off the call — whether that's waiting for the caller to speak first, using an AI-generated greeting that adapts to context, or delivering a custom greeting you've written yourself. Prompt Editor Interface Prompt Editor Interface ### Writing Effective Prompts A strong prompt usually includes: - **A clear goal** → what is the agent trying to achieve on this call? - **Background context** → who is the agent, and what key details should they know? - **Conversation flow** → the step-by-step path the agent should follow to reach the goal ### Using the Prompt Template To make this easier, Trillet provides a prompt template you can follow. Instead of starting from scratch, the template gives you a ready-made structure that covers all the essentials: defining your agent's role, setting formatting rules, and mapping out the conversation flow. **Example Prompt Structure:** If your agent's goal is to qualify leads for a demo, your prompt might: - Set the goal as confirming interest and booking a demo slot - Provide background context like "You are Alex, a friendly sales assistant from Acme Software" - Outline a conversation flow where the agent greets the lead, confirms their availability, and suggests two demo times ### Testing Your Agent You can test your agent through both **Voice Chat** and **Text Chat**. **Voice Chat** lets you experience how it sounds in a live call, while **Text Chat** makes it easy to review responses in writing. Both methods allow you to fine-tune your prompt and improve the agent's performance.
Save & Test Agent Button Save & Test Agent Button

When you're ready to test, click the **Save & Test Agent** button in the top-right corner of the prompt editor.

You can test your agent through both **Voice Chat** and **Text Chat**:
Test Agent Interface Test Agent Interface

- **Voice Chat** lets you experience how it sounds in a live call - **Text Chat** makes it easy to review responses in writing Both methods allow you to fine-tune your prompt and improve the agent's performance.

It's always a good idea to test your prompt with different variations to see what gives you the most natural results. ## 1.3 Assigning a Phone Number When you're ready to take your AI agent live, it needs a phone number that people can call. Assigning a number is what connects your agent to the outside world, allowing it to handle real conversations instead of just test runs. Phone Number Management Phone Number Management ### Number Options Trillet gives you two options: **1. Buy a New Number** - Purchase directly through the platform - Quick setup and ready to use right away - Search by country, type (local or toll-free), state, or area code Number Purchase Interface Number Purchase Interface **2. Bring Your Own Number** - Link an existing number from providers like Twilio - Keep using your existing carrier rates - Manage everything from within Trillet Bring Your Own Number Bring Your Own Number ### Number Assignment Once you have a number, you can assign it to your AI agent: Number Assignment Interface Number Assignment Interface Configuration options include: - Choose whether to assign to a call or message flow - Select the agent it should connect with - Enable call recording - Add metadata tags for dynamic interactions ### Next Steps After Assignment Once your number is linked, you can configure: - Maximum call duration - Call recording settings - Business hours - Call or Message flow assignment When everything is configured, your number is live and ready. Make a quick test call to confirm everything works as expected. ## 1.4 Sending and Receiving Calls Once a phone number is assigned to your AI agent, you can configure how it handles incoming and outgoing calls. ### Single Calls To assign a single number: go to **Sidebar → Calls → Single Call** Simply select the agent you want to map the number to (the same agent you assigned the phone number to) and enter the number where you'd like to receive the calls. You can also use our [Voice Calls API](/v1/api-reference/endpoints/calls/initiate-call) to programmatically initiate calls: ```bash curl -X POST https://api.trillet.ai/v1/api/call \ -H "x-api-key: YOUR_API_KEY" \ -H "x-workspace-id: YOUR_WORKSPACE_ID" \ -H "Content-Type: application/json" \ -d '{ "call_agent_id": "your_agent_id", "to": "+1234567890" }' ``` ### Batch Calls Trillet also gives you the ability to place batch calls. To access this feature: **Sidebar → Calls → Batch Calls** Batch Calls let you reach multiple contacts at once instead of dialing them individually. This is especially helpful for: - Lead reactivation campaigns - Appointment reminders - Survey collection - Follow-up calls **Setup Process:** 1. Select an agent 2. Upload a CSV file with contact details 3. Schedule when the calls should go out 4. Review past batches under "View History" to track performance For large-scale operations, consider using our [Batch Calls API](/v1/api-reference/endpoints/calls/batch/overview) to programmatically manage batch calls and monitor their status. ## 1.5 Setting up Transfers Transfers let your agent hand a call over to a real person or another system when needed. This is useful for situations where the conversation requires human support, a specialized team, or a different department. Transfer Configuration Transfer Configuration ### Transfer Setup Steps 1. **Click Add New Transfer** 2. **Enter a friendly name** (e.g., Support Team) 3. **Select the transfer type** 4. **Choose the destination type** (Phone Number/SIP Address or Phone Metadata Tags) 5. **Enter the destination** in the valid format: - Phone: `+12025550123` - SIP: `sip:user@domain.com` 6. **Save your transfer** - your agent will now know where to route calls when triggered ### Transfer Types - **Warm Transfer**: Agent stays on the line during handoff - **Cold Transfer**: Agent immediately transfers and disconnects Make sure to test your transfer destinations to ensure they're properly configured and accessible. ## API Integration Throughout this guide, we've focused on the visual interface, but every feature is also available through our comprehensive REST API: Create and manage conversational agents programmatically Design conversation flows via API Initiate and manage calls programmatically Handle real-time conversations ## Next Steps Now that you've set up your first AI agent, explore these advanced features: Scale your implementation with whitelabel tools Track performance and optimize your agents Learn advanced prompting techniques for better conversations Connect your agent to external systems ## Support & Resources Complete API reference and examples Join our developer community Get a support plan for direct technical help and guidance --- ## Code Blocks *Display inline code and code blocks* ## Basic ### Inline Code To denote a `word` or `phrase` as code, enclose it in backticks (`). ``` To denote a `word` or `phrase` as code, enclose it in backticks (`). ``` ### Code Block Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language. ```java HelloWorld.java class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ``` ````md ```java HelloWorld.java class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ``` ```` --- ## Images and Embeds *Add image, video, and other HTML elements* ## Image ### Using Markdown The [markdown syntax](https://www.markdownguide.org/basic-syntax/#images) lets you add images using the following code ```md ![title](/path/image.jpg) ``` Note that the image file size must be less than 5MB. Otherwise, we recommend hosting on a service like [Cloudinary](https://cloudinary.com/) or [S3](https://aws.amazon.com/s3/). You can then use that URL and embed. ### Using Embeds To get more customizability with images, you can also use [embeds](/writing-content/embed) to add images ```html ``` ## Embeds and HTML elements