Authentication
DRIP/KG-RAG uses API keys for authentication. This guide covers generating keys, configuring SDKs, managing permissions, and best practices for secure access.
Authentication Methods
DRIP/KG-RAG supports two authentication methods:
API Key Authentication
Recommended for most use cases. Simple, secure, and easy to manage.
X-API-Key: drip_1234567890abcdefBearer Token Authentication
For OAuth flows and temporary access. Ideal for web applications.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Generating API Keys
Using the CLI
Using the Admin Dashboard
- Navigate to http://localhost:3001/api-keys (Local)
- Log in with your credentials if required
- Click Generate New Key
- Configure key name, expiration, and permissions
- Copy and securely store the generated key
Configuring SDKs
Python (Functor SDK)
Environment Variables (Recommended)
.env
Direct Configuration
Python (MCP SDK)
Node.js
cURL (REST API)
API Key Management
Listing API Keys
Revoking API Keys
Rotating API Keys
Permissions and Scopes
API keys can be restricted with specific scopes:
readQuery data and list resourceswriteUpload documents and create resourcesdeleteDelete sources and resourcesadminFull system administration accessCreating Scoped Keys
Security Best Practices
✅ Do's
- Store keys securely: Use environment variables or secret management services
- Rotate keys regularly: Set expiration dates and rotate before expiry
- Use scoped keys: Grant minimum required permissions
- Monitor usage: Track API key usage and anomalies
- Use HTTPS: Always use HTTPS in production environments
- Separate keys per environment: Different keys for dev/staging/production
❌ Don'ts
- Don't commit keys to git: Never include API keys in source code
- Don't share keys: Each application should have its own key
- Don't use keys in URLs: Pass keys in headers, not query parameters
- Don't ignore expiration: Set reasonable expiration dates
- Don't use admin keys for apps: Create scoped keys instead
Error Handling
Authentication Errors
Common Error Responses
Rate Limiting
API keys are subject to rate limits based on their tier:
| Tier | Requests/minute | Requests/day | Burst |
|---|---|---|---|
| Free | 60 | 1,000 | 10 |
| Standard | 300 | 10,000 | 50 |
| Pro | 1,000 | 100,000 | 200 |
| Enterprise | Unlimited | Unlimited | Unlimited |