Everything you need to embed Travis on your site, connect your knowledge base, and interact with the API.
Add Travis to any website in 60 seconds. Sign up, grab your API key, and paste one script tag before your closing </body>.
<script src="https://travis-ai.net/app/api/widget.php
?key=tvs_your_api_key"></script>
That's it. Travis will appear as a chat button in the bottom-right corner of your page. To customize behavior, see Widget Parameters.
Your API key identifies your tenant and is required for all widget embeds and API calls. You can create, rotate, and revoke keys from the admin dashboard under Settings → API Keys.
All API keys are prefixed with tvs_ followed by 32 random characters. Example: tvs_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6.
The widget script is served dynamically and includes your tenant's branding, persona name, and settings automatically. No additional configuration is needed for a standard embed.
<script
src="https://travis-ai.net/app/api/widget.php?key=tvs_YOUR_KEY"
data-position="bottom-right"
data-open="false"
></script>
Pass these as data-* attributes on the script tag:
| Parameter | Default | Description |
|---|---|---|
| data-position | bottom-right | Widget placement: bottom-right, bottom-left, top-right, top-left. Overrides the admin panel setting. |
| data-open | false | Set to true to open the chat window on page load. |
| data-greeting | (from settings) | Override the welcome message for this page only. |
| data-theme | light | light or dark. |
| data-z-index | 9999 | CSS z-index of the widget container. |
Travis emits browser events you can listen to:
window.addEventListener('travis:open', () => {
console.log('Widget opened');
});
window.addEventListener('travis:close', () => {
console.log('Widget closed');
});
window.addEventListener('travis:message', (e) => {
console.log('New message:', e.detail);
});
Travis uses Retrieval-Augmented Generation (RAG) to ground answers in your content. When a visitor asks a question, Travis retrieves the most relevant chunks from your knowledge base and passes them as context to the language model.
Upload knowledge base content from the admin dashboard under Knowledge Base. Supported sources:
Send a chat message programmatically.
POST https://travis-ai.net/app/api/chat.php
Authorization: Bearer tvs_YOUR_KEY
Content-Type: application/json
{
"message": "What is your return policy?",
"session_id": "visitor_abc123"
}
{
"reply": "We offer a 30-day no-questions-asked return policy.",
"session_id": "visitor_abc123",
"sources": [
{ "title": "Returns Policy.pdf", "score": 0.91 }
]
}
Add a knowledge base document programmatically.
POST https://travis-ai.net/app/api/knowledge.php
Authorization: Bearer tvs_YOUR_KEY
Content-Type: application/json
{
"type": "text",
"title": "Refund Policy",
"content": "We offer a full refund within 30 days..."
}
Retrieve usage stats for the current billing period.
GET https://travis-ai.net/app/api/usage.php
Authorization: Bearer tvs_YOUR_KEY
{
"period_start": "2025-06-01",
"period_end": "2025-06-30",
"messages_used": 842,
"messages_limit": 1000,
"rag_retrievals": 615,
"tokens_used": 124300
}
| HTTP Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key. |
| 403 | forbidden | Action not allowed on this plan. |
| 429 | rate_limited | Too many requests. See rate limits below. |
| 402 | limit_exceeded | Monthly message limit reached. |
| 500 | server_error | Internal error. Contact support. |
API requests are rate-limited per API key:
If you need higher limits, contact us about a Pro or Enterprise plan.