First Steps with Enclava
After installing Enclava, follow these steps to configure and test your instance.
Step 1: Verify Installation
Check that all services are running:
docker compose ps
All services should show "Up" status:
- enclava-backend
- enclava-frontend
- enclava-postgres
- enclava-redis
- enclava-qdrant
Step 2: Access Web Interface
Navigate to http://localhost in your browser.
Initial Login
Use the default credentials:
- Email: admin@example.com
- Password: admin123
Important: Change these credentials immediately!
Step 3: Change Admin Password
- Go to Settings in the sidebar
- Navigate to Profile or User Management
- Change your password to a secure value
- Save changes
Step 4: Get PrivateMode API Key
For confidential LLM processing:
- Visit privatemode.ai
- Sign up and create an account
- Generate an API key
- Update your
.envfile:
PRIVATEMODE_API_KEY=your-privatemode-api-key-here
- Restart containers:
docker compose restart enclava-backend
Step 5: Create Your First API Key
Via Web Interface
- Navigate to API Keys in the sidebar
- Click Create API Key
- Fill in the form:
- Name: My First Key
- Description: Testing Enclava API
- Allowed Models: Leave empty for all models
- Budget: Set optional spending limits
- Click Create
Copy Your API Key
⚠️ Important: Copy the API key now - you won't see it again!
The key will look like: en_xxxxxxxxxxxxxxxxxxxxxxxx
Step 6: Test the Connection
Using cURL
curl http://localhost/api/v1/health
Expected response:
{
"status": "healthy",
"app": "Enclava",
"version": "1.0.0"
}
Using Python
import requests
response = requests.get("http://localhost/api/v1/health")
print(response.json())
Using JavaScript/Node.js
const response = await fetch('http://localhost/api/v1/health');
const data = await response.json();
console.log(data);
Step 7: Make Your First Chat Completion
Using cURL
curl -X POST http://localhost/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello, Enclava!"}]
}'
Using Python
import requests
response = requests.post(
"http://localhost/api/v1/chat/completions",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello, Enclava!"}]
}
)
data = response.json()
print(data["choices"][0]["message"]["content"])
Using JavaScript
const response = await fetch('http://localhost/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello, Enclava!' }]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
Step 8: Explore Available Models
import requests
response = requests.get(
"http://localhost/api/v1/models",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
models = response.json()["data"]
for model in models:
print(f"ID: {model['id']}")
print(f"Owned by: {model['owned_by']}")
print("-" * 40)
Step 9: Check API Documentation
Visit http://localhost/api/v1/docs to explore:
- All available endpoints
- Request/response schemas
- Try endpoints directly from the browser
- View authentication requirements
Common Setup Issues
API Key Not Working
Problem: 401 Unauthorized errors
Solutions:
- Verify the key is copied correctly (no extra spaces)
- Check the key hasn't been revoked
- Ensure you're using the correct base URL
Connection Refused
Problem: Cannot connect to localhost
Solutions:
- Verify Docker containers are running:
docker compose ps - Check if port 8000 is available
- Try using
http://localhost:8000if using Docker directly
Model Not Available
Problem: "Model not found" error
Solutions:
- Verify PrivateMode API key is configured
- Check which models are available:
GET /api/v1/models - Ensure your API key has access to the model
What's Next?
Now that Enclava is running, explore:
- OpenAI Compatible API - Use existing OpenAI clients
- Create a Chatbot - Build an AI assistant
- Upload Documents for RAG - Create a knowledge base
- Build an Agent - AI agents with tool calling
Best Practices
- Secure Your Keys: Store API keys in environment variables, never in code
- Use Specific Keys: Create separate keys for different applications
- Set Budgets: Always set spending limits on new API keys
- Monitor Usage: Check analytics regularly to understand usage patterns
- Handle Errors: Implement proper error handling in your applications