API Overview
The IntelliRepo API lets you integrate AI-powered document Q&A into your applications. This guide covers the basics of using the API.
Base URL
https://api.intellirepo.ai/api/v1All API endpoints use this base URL.
Authentication
All API requests require authentication via API key:
curl https://api.intellirepo.ai/api/v1/collections \
-H "Authorization: Bearer rh_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"See Authentication for details on creating and managing API keys.
Key Endpoints
Collections
| Method | Endpoint | Description |
|---|---|---|
| GET | /collections | List all collections |
| POST | /collections | Create a collection |
| GET | /collections/{id} | Get collection details |
| PATCH | /collections/{id} | Update a collection |
| DELETE | /collections/{id} | Delete a collection |
Documents
| Method | Endpoint | Description |
|---|---|---|
| GET | /collections/{id}/documents | List documents |
| POST | /collections/{id}/documents | Upload a document |
| GET | /collections/{id}/documents/{doc_id} | Get document details |
| PATCH | /collections/{id}/documents/{doc_id} | Update document metadata |
| DELETE | /collections/{id}/documents/{doc_id} | Delete a document |
Chat & Search
| Method | Endpoint | Description |
|---|---|---|
| POST | /chat | Chat across all collections |
| POST | /collections/{id}/chat | Chat within a collection |
| POST | /chat/stream | Streaming chat response |
| POST | /search | Search all collections |
| POST | /collections/{id}/search | Search within a collection |
Request Format
Send JSON in request bodies:
curl -X POST https://api.intellirepo.ai/api/v1/collections \
-H "Authorization: Bearer rh_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Product Documentation",
"description": "API guides and references"
}'Response Format
All responses are JSON:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Product Documentation",
"description": "API guides and references",
"document_count": 0,
"created_at": "2024-01-15T10:30:00Z"
}Error Responses
Errors include a status code and message:
{
"detail": "Collection not found"
}| Status | Meaning |
|---|---|
| 400 | Bad request (invalid input) |
| 401 | Unauthorized (invalid API key) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Resource not found |
| 422 | Validation error |
| 429 | Rate limit exceeded |
| 500 | Server error |
Chat Example
Ask a question and get an AI-generated answer:
curl -X POST https://api.intellirepo.ai/api/v1/chat \
-H "Authorization: Bearer rh_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"question": "What is the refund policy?"
}'Response:
{
"question": "What is the refund policy?",
"answer": "According to the documentation, customers can request a full refund within 30 days of purchase...",
"sources": [
{
"document_name": "Return-Policy.pdf",
"document_id": "uuid",
"collection_name": "Policies",
"page_number": 3,
"similarity": 0.89,
"chunk_text": "Customers may request a full refund..."
}
]
}Streaming Responses
For real-time responses, use the streaming endpoint:
curl -X POST https://api.intellirepo.ai/api/v1/chat/stream \
-H "Authorization: Bearer rh_live_xxx" \
-H "Content-Type: application/json" \
-d '{"question": "Explain the onboarding process"}'Returns Server-Sent Events (SSE):
event: sources
data: {"sources": [...]}
event: chunk
data: {"text": "The onboarding"}
event: chunk
data: {"text": " process involves"}
event: done
data: {"usage": {"input_tokens": 150, "output_tokens": 200}}Rate Limits
API requests count toward your plan's query limit:
| Plan | Queries/Month |
|---|---|
| Solo | 500 |
| Pro | 2,000 |
| Team | 10,000 |
| Enterprise | 75,000 |
When exceeded, requests return HTTP 429. Paid plans support overages at $0.05/query.
SDKs
We provide official SDKs for easier integration:
- JavaScript SDK - For Node.js and browsers
- Python SDK - For Python applications
SDKs handle authentication, error handling, and provide typed interfaces.
Pagination
List endpoints support pagination:
curl "https://api.intellirepo.ai/api/v1/collections?limit=10&offset=0" \
-H "Authorization: Bearer rh_live_xxx"| Parameter | Default | Description |
|---|---|---|
limit | 50 | Items per page (max 100) |
offset | 0 | Number of items to skip |
Response includes total count:
{
"collections": [...],
"total": 25,
"limit": 10,
"offset": 0
}Related Articles
Need Help?
Contact our support team if you have questions about the API.