Dashboard
📚 API Documentation
Learn how to integrate your AI chatbot into any application. Simple REST API with support for all major frameworks.
1. Create a Project
Go to your dashboard and create a new chatbot project. You'll receive a unique Project ID and API Secret (required for all API calls).
2. Add Q&A Pairs
Navigate to the "Q&A Pairs" tab and add questions and answers that your chatbot should know about.
3. Get Your API Secret
Important: All API endpoints require authentication using your API secret key. You can find it in your project's Overview tab. Store it securely in environment variables.
Authorization: Bearer YOUR_API_SECRET// ORX-API-Key: YOUR_API_SECRET4. Integrate with Your App
Use the Integration tab to get code examples for your framework (React, Vue, Angular, etc.). All examples include API secret authentication.
5. Start Chatting!
Your chatbot is now ready. Test it in the "Test Chatbot" tab or integrate it into your application.
POST/api/[projectId]/chat
Send a message to the chatbot and receive a response.
Request Body
{
"id": "J0KlZoImX2syFEDf",
"messages": [
{
"role": "user",
"parts": [
{
"type": "text",
"text": "What are your business hours?"
}
],
"id": "mvUG0kf5fdSaCzEY"
}
],
"trigger": "submit-message"
}Note: The id and trigger fields are optional. The messages array must contain at least one message with role: "user"and a parts array containing text parts.
Response (Stream)
// Streams AI response in real-time
// Compatible with Vercel AI SDK useChat() hookHeaders (Required)
Content-Type: application/json
Authorization: Bearer YOUR_API_SECRET
// OR
X-API-Key: YOUR_API_SECRET⚠️ API Secret Key is required - Get your API secret from your project dashboard. This endpoint is public and requires authentication.
GET/api/[projectId]/chat
Retrieve chat history for a project.
Headers (Required)
Authorization: Bearer YOUR_API_SECRET
// OR
X-API-Key: YOUR_API_SECRET⚠️ API Secret Key is required - This endpoint is public and requires authentication.
Response
{
"history": [
{
"id": "abc123",
"question": "What are your business hours?",
"answer": "We are open Mon-Fri 9am-5pm.",
"relevanceScore": 0.95,
"createdAt": "2024-01-15T10:30:00Z"
}
]
}GET/api/[projectId]/analytics?period=7d
Get usage analytics for your chatbot.
Headers (Required)
Authorization: Bearer YOUR_API_SECRET
// OR
X-API-Key: YOUR_API_SECRET⚠️ API Secret Key is required - This endpoint is public and requires authentication.
Query Parameters
- •
period: "7d" | "1w" | "30d" (default: "7d")
Response
{
"totalRequests": 1234,
"requestsToday": 45,
"averageRelevanceScore": 0.87,
"dailyData": [...],
"hourlyData": [...],
"topQuestions": [...]
}React with Vercel AI SDK
⭐ RecommendedNext.js App Router
React (Fetch API)
Vue.js
Angular
Svelte
Vanilla JavaScript
Get code examples for all frameworks in your dashboard's Integration tab.
- ✓
Use Environment Variables for API Secret
Store your API secret in environment variables, never hardcode it. The API secret is required for all API endpoints.
- ✓
Implement Error Handling
Always handle API errors gracefully in your application.
- ✓
Use Streaming Responses
For better UX, use Vercel AI SDK to stream responses in real-time.
- ✓
Monitor Analytics
Regularly check your analytics to improve chatbot performance.
- ✓
Keep Q&A Pairs Updated
Add new questions based on user inquiries to improve relevance.
