PostgreSQL Vector Database API

A simple API for storing and searching documents using vector embeddings.

Store Document
Any valid username is accepted
Document content for embedding generation
Any valid username is accepted
Leave empty to use filename
Supported: PDF, HTML, TXT files
Your current API token: gW0YM1rpPRU7v72qlyqJ8gAE1Z33VIPR7iOAqBkjBqI
Query Monitoring
0

Total Queries

0

Successful

0

Failed

0%

Success Rate

Timestamp Endpoint Query Results Threshold Time (ms)
No successful queries yet
Timestamp Endpoint Query Error Status Code
No failed queries yet
Search Documents
Search for similar documents
Minimum similarity score (0.0-1.0). Default: 0.7
Results
Results will appear here after storing or searching documents.
API Documentation
Authentication Required: All endpoints require Bearer token authentication:
Authorization: Bearer <API_TOKEN>
Collections Support: Organize documents within usernames using collections
  • /api/<username>/endpoint - operates on all documents for username
  • /api/<username>/<collection>/endpoint - operates only on specific collection
Store Document (JSON)
Username-only: PUT /api/{username}/documents
Collection-specific: PUT /api/{username}/{collection}/documents
{
  "title": "Document Title",
  "content": "Document content to be embedded"
}
                                
Upload File
POST /api/{username}/documents
POST /api/{username}/{collection}/documents
Content-Type: multipart/form-data
Fields: file (PDF, HTML, TXT), title (optional)
Plain Text Embedding
POST /api/{username}/embed
POST /api/{username}/{collection}/embed
{
  "content": "Plain text content with auto-generated title"
}
                                
Vector Similarity Search
Search all documents: GET /api/{username}/search
Search collection only: GET /api/{username}/{collection}/search
Query Parameters:
  • q (required) - Search query text
  • threshold (optional) - Minimum similarity score (0.0-1.0, default: 0.7)
  • limit (optional) - Maximum results (default: 10)
Example: GET /api/robotscooking/search?q=machine%20learning&threshold=0.8&limit=5
Response Format:
{
  "results": [
    {
      "id": "uuid-string",
      "title": "Document Title",
      "content": "Document content...",
      "similarity": 0.85,
      "username": "user",
      "collection": "collection_name",
      "created_at": "2025-07-31T14:16:30Z"
    }
  ],
  "total": 1
}
                                    
List Documents
All user documents: GET /api/{username}/documents
Collection documents: GET /api/{username}/{collection}/documents
Query Logs
GET /api/{username}/logs
GET /api/{username}/{collection}/logs
Access monitoring and usage statistics
Error Responses
{
  "success": false,
  "error": "Error description",
  "details": "Additional error details"
}
                                    
Status Codes: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not Found), 413 (Too Large), 500 (Server Error)