API & Embed Integration
Add your AI assistant to any website with a single script, or integrate MorseMind's hybrid RAG search and document indexing directly via REST endpoints.
Authenticate REST requests with Authorization: Bearer header.
Embed
Add your assistant to any website with one script.
Add the chatbot to any website
Copy this script and paste it just before the closing </body> tag of your website.
<script async src="http://localhost:4000/embed/imorse-rag-widget.js" data-bot-id="bot_9744a767a6ab48eaa454b14e18ce7c64"></script>Ready to embed
Your assistant loads as a lightweight floating widget and uses the Appearance settings you saved.
REST API Reference
Explore REST endpoints for managing assistants, uploading sources, and performing RAG searches.
Endpoints List
Rate Limits:
Standard tier: 600 requests / minute per API key.
Send Message & Get RAG Response
Queries the specified assistant with natural language. MorseMind retrieves relevant knowledge passages using hybrid search and returns a grounded answer with citations.
Request Parameters
The user prompt or query.
Stream response tokens via Server-Sent Events (SSE). Default is false.
Number of relevant knowledge passages to retrieve. Default is 5.
import { MorseMind } from '@morsemind/sdk';
const morsemind = new MorseMind({
apiKey: process.env.MORSEMIND_API_KEY
});
const response = await morsemind.assistants.chat('asst_9f83a', {
message: 'When is the NEET exam schedule?',
stream: false,
topK: 5,
});
console.log(response.answer);
console.log(response.citations);{
"id": "msg_893fa12",
"assistant_id": "asst_9f83a",
"answer": "The NEET exam schedule is typically announced by NTA on the official portal.",
"confidence": 0.98,
"citations": [
{
"source_title": "NEET Guide 2026.pdf",
"page": 4,
"snippet": "NTA conducts NEET UG annually..."
}
]
}