Overview
OpenViking uses a two-layer API key system:All API keys are plain random tokens with no embedded identity. The server resolves identity by first comparing against the root key, then looking up the user key index.
Server Setup
1
Configure Root Key
Add the
root_api_key to ov.conf:2
Start Server
3
Verify
Managing Accounts and Users
Use the root key to create accounts (workspaces) and users via the Admin API.Create Account
The first user in an account is automatically assigned the ADMIN role.
Register Regular User
Using API Keys
HTTP Headers
OpenViking accepts API keys via two headers:Python SDK
CLI
Create~/.openviking/ovcli.conf:
Roles and Permissions
ROOT Role
ROOT Role
Full system access:
- Create and delete accounts
- Manage users across all accounts
- Change user roles
- All regular operations
- Access admin endpoints
ADMIN Role
ADMIN Role
Account-level management:
- Register users in own account
- Remove users from own account
- Regenerate user keys
- All regular operations within account
USER Role
USER Role
Standard operations:
- Add and manage resources
- Create and manage sessions
- Search and retrieve context
- File system operations (ls, read, tree, etc.)
Admin API Reference
Account Management
Create Account
Create Account
POST Response:
/api/v1/admin/accountsRole: ROOTRequest:List Accounts
List Accounts
GET
/api/v1/admin/accountsRole: ROOTResponse:Delete Account
Delete Account
DELETE
/api/v1/admin/accounts/{account_id}Role: ROOTExample:User Management
Register User
Register User
POST Response:
/api/v1/admin/accounts/{account_id}/usersRole: ROOT, ADMINRequest:List Users
List Users
GET
/api/v1/admin/accounts/{account_id}/usersRole: ROOT, ADMINResponse:Remove User
Remove User
DELETE
/api/v1/admin/accounts/{account_id}/users/{user_id}Role: ROOT, ADMINExample:Change User Role
Change User Role
PUT
/api/v1/admin/accounts/{account_id}/users/{user_id}/roleRole: ROOTRequest:Regenerate Key
Regenerate Key
POST
/api/v1/admin/accounts/{account_id}/users/{user_id}/keyRole: ROOT, ADMINResponse:Development Mode
When noroot_api_key is configured, authentication is disabled.
Unauthenticated Endpoints
The/health endpoint never requires authentication:
This allows load balancers and monitoring tools to check server health without credentials.
Best Practices
1
Generate Strong Keys
Use cryptographically secure random keys:
2
Rotate Keys Regularly
Regenerate user keys periodically:
3
Use Separate Keys per Agent
Create different user keys for each agent/service:
4
Store Keys Securely
Use environment variables or secret managers:
Related Resources
Configuration
Server configuration reference
Deployment
Production deployment guide
Python SDK
Client authentication setup
CLI Usage
CLI authentication setup
