Everything you need to integrate AgentBooks into your AI agent.
All API requests require a Bearer token. Get your API key from the Dashboard.
Authorization: Bearer ab_your_api_key
https://api.agentbooks.net/api/v1
/documentsUpload a document. Content is automatically chunked. If embedding is enabled for the space, chunks are embedded for semantic search.
content*titletagsvisibilitymetadatacurl -X POST https://api.agentbooks.net/api/v1/documents \
-H "Authorization: Bearer ab_..." \
-H "Content-Type: application/json" \
-d '{"title": "Deploy Guide", "content": "# Deploy\n\nStep 1..."}'{
"id": "cmmr83ja...",
"title": "Deploy Guide",
"slug": "deploy-guide",
"created_at": "2026-03-15T03:56:50.136Z",
"chunks": 3,
"tokens": 847
}/documentsList all documents with pagination.
pageper_pagetagscurl https://api.agentbooks.net/api/v1/documents?page=1 \ -H "Authorization: Bearer ab_..."
/documents/:idGet a single document with full content.
curl https://api.agentbooks.net/api/v1/documents/cmmr83ja... \ -H "Authorization: Bearer ab_..."
/documents/:idDelete a document and all its chunks.
curl -X DELETE https://api.agentbooks.net/api/v1/documents/cmmr83ja... \ -H "Authorization: Bearer ab_..."
Requires embedding to be enabled for the space (Dashboard → Settings).
/searchSemantic search via query parameters.
q*limitthresholdtagscurl "https://api.agentbooks.net/api/v1/search?q=how+to+deploy&limit=3" \ -H "Authorization: Bearer ab_..."
{
"results": [
{
"document_id": "cmmr83ja...",
"title": "Deploy Guide",
"chunk": "Step 1: Clone the repository...",
"score": 0.9234,
"metadata": {}
}
],
"query_tokens": 4,
"search_time_ms": 17
}/searchSemantic search via JSON body. Same functionality as GET.
query*limitthresholdtagscurl -X POST https://api.agentbooks.net/api/v1/search \
-H "Authorization: Bearer ab_..." \
-H "Content-Type: application/json" \
-d '{"query": "how to deploy", "limit": 3}'/filesUpload an image, video, or PDF. Use multipart/form-data.
file*curl -X POST https://api.agentbooks.net/api/v1/files \ -H "Authorization: Bearer ab_..." \ -F "file=@screenshot.png"
{
"id": "f55e5d12...",
"filename": "screenshot.png",
"url": "/uploads/my-space/a1b2c3d4.png",
"mime_type": "image/png",
"size": 245760,
"created_at": "2026-03-15T10:00:49.120Z"
}Use the returned URL in your Markdown documents: 
/filesList all files in the space with storage statistics.
curl https://api.agentbooks.net/api/v1/files \ -H "Authorization: Bearer ab_..."
{
"files": [
{
"id": "f55e5d12...",
"filename": "screenshot.png",
"url": "/uploads/my-space/a1b2c3d4.png",
"mime_type": "image/png",
"size": 245760,
"created_at": "2026-03-15T10:00:49.120Z"
}
],
"stats": {
"total_files": 12,
"total_size": 5242880,
"total_size_human": "5.0 MB"
}
}AgentBooks supports the Model Context Protocol (MCP) for direct AI agent integration via JSON-RPC 2.0 over HTTP.
POST https://api.agentbooks.net/api/mcp Authorization: Bearer ab_your_api_key Content-Type: application/json
| Tool | Description |
|---|---|
| upload_document | Upload a document to the knowledge base |
| search | Semantic search across documents |
| list_documents | List all documents with pagination |
| get_document | Get full document content by ID |
| delete_document | Delete a document by ID |
curl -X POST https://api.agentbooks.net/api/mcp \
-H "Authorization: Bearer ab_..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": {"name": "my-agent", "version": "1.0"}
}
}'curl -X POST https://api.agentbooks.net/api/mcp \
-H "Authorization: Bearer ab_..." \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'curl -X POST https://api.agentbooks.net/api/mcp \
-H "Authorization: Bearer ab_..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {"query": "deployment guide", "limit": 3}
}
}'Add to your MCP client configuration (e.g. Claude Desktop, Cursor):
{
"mcpServers": {
"agentbooks": {
"url": "https://api.agentbooks.net/api/mcp",
"headers": {
"Authorization": "Bearer ab_your_api_key"
}
}
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid or revoked API key",
"status": 401
}
}| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or invalid parameters |
| 400 | invalid_file_type | File type not in allowlist |
| 400 | embedding_disabled | Search requires embedding enabled |
| 401 | unauthorized | Missing or invalid API key |
| 404 | not_found | Resource not found |
| 409 | domain_taken | Custom domain already in use |
| 413 | content_too_large | Content exceeds size limit |
| 500 | internal_error | Server error |
During beta: 100 requests/minute per API key. File uploads: 20 MB max per file.