Overview
OpenViking uses a two-layer API key system:| Key Type | Created By | Role | Purpose |
|---|---|---|---|
| Root Key | Server config (root_api_key) | ROOT | Full access + admin operations |
| User Key | Admin API | ADMIN or USER | Per-account access |
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
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
| Role | Scope | Capabilities |
|---|---|---|
| ROOT | Global | All operations + Admin API (create/delete accounts, manage users) |
| ADMIN | Own account | Regular operations + manage users in own account |
| USER | Own account | Regular operations (ls, read, find, sessions, etc.) |
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
Related Resources
Configuration
Server configuration reference
Deployment
Production deployment guide
Python SDK
Client authentication setup
CLI Usage
CLI authentication setup
