Skip to main content
OpenViking Server supports multi-tenant API key authentication with role-based access control for secure production deployments.

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:
Generate a secure key with: openssl rand -base64 32
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

Response:
The first user in an account is automatically assigned the ADMIN role.

Register Regular User

Response:

Using API Keys

HTTP Headers

OpenViking accepts API keys via two headers:

Python SDK

CLI

Create ~/.openviking/ovcli.conf:
Then use the CLI:

Roles and Permissions

Full system access:
  • Create and delete accounts
  • Manage users across all accounts
  • Change user roles
  • All regular operations
  • Access admin endpoints
Use case: System administrators
Account-level management:
  • Register users in own account
  • Remove users from own account
  • Regenerate user keys
  • All regular operations within account
Use case: Team leads, project managers
Standard operations:
  • Add and manage resources
  • Create and manage sessions
  • Search and retrieve context
  • File system operations (ls, read, tree, etc.)
Use case: Regular users, agents

Admin API Reference

Account Management

POST /api/v1/admin/accountsRole: ROOTRequest:
Response:
GET /api/v1/admin/accountsRole: ROOTResponse:
DELETE /api/v1/admin/accounts/{account_id}Role: ROOTExample:

User Management

POST /api/v1/admin/accounts/{account_id}/usersRole: ROOT, ADMINRequest:
Response:
GET /api/v1/admin/accounts/{account_id}/usersRole: ROOT, ADMINResponse:
DELETE /api/v1/admin/accounts/{account_id}/users/{user_id}Role: ROOT, ADMINExample:
PUT /api/v1/admin/accounts/{account_id}/users/{user_id}/roleRole: ROOTRequest:
POST /api/v1/admin/accounts/{account_id}/users/{user_id}/keyRole: ROOT, ADMINResponse:

Development Mode

When no root_api_key is configured, authentication is disabled.
Security: Dev mode (no auth) is only allowed when binding to localhost (127.0.0.1, localhost, or ::1). If host is set to 0.0.0.0 without a root_api_key, the server will refuse to start.

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:

Configuration

Server configuration reference

Deployment

Production deployment guide

Python SDK

Client authentication setup

CLI Usage

CLI authentication setup