Quick Start
Get your first answer in about 5 minutes.
Dashboard steps require the X-Clerk-User-Id header. Public chat uses an API key in the JSON body.
Step 1 — Create a knowledge base
POST
/kbscurl
curl -X POST https://api.docubix.com/api/v1/kbs \
-H "Content-Type: application/json" \
-H "X-Clerk-User-Id: your_clerk_user_id" \
-d '{"name": "Product Docs"}'json
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Product Docs",
"status": "active"
}Step 2 — Upload a document
POST
/kbs/{kb_id}/documentscurl
curl -X POST https://api.docubix.com/api/v1/kbs/{kb_id}/documents \
-H "X-Clerk-User-Id: your_clerk_user_id" \
-F "file=@billing-faq.md"Processing runs asynchronously. Poll document status until it reaches completed.
Step 3 — Create an API key
POST
/kbs/{kb_id}/api-keyscurl
curl -X POST https://api.docubix.com/api/v1/kbs/{kb_id}/api-keys \
-H "Content-Type: application/json" \
-H "X-Clerk-User-Id: your_clerk_user_id" \
-d '{"name": "Production"}'Save the api_key from the response — it is only shown once.
Step 4 — Ask a question
POST
/chatcurl
curl -X POST https://api.docubix.com/api/v1/chat \
-H "Content-Type: application/json" \
-d '{
"api_key": "rag_live_your_api_key_here",
"message": "How do I cancel my subscription?"
}'Pass the conversation_id from the response on follow-up messages to continue the same chat.
Result
json
{
"conversation_id": "550e8400-e29b-41d4-a716-446655440000",
"answer": "You can cancel anytime from Billing in your dashboard. Your plan stays active until the end of the current billing period, and you won't be charged again after that.",
"sources": [
{
"document": "billing-faq.md",
"chunk_id": "abc123",
"score": 0.92,
"page": 4
}
],
"usage": {
"input_tokens": 1200,
"output_tokens": 85
},
"metadata": {
"retrieved_chunks": 3,
"retrieval_score": 0.92,
"model": "gpt-5.2"
}
}