Every request to the Universe REST API must carry a valid Bearer token. There are no anonymous endpoints — even health checks benefit from token authentication when the cluster is internet-accessible. This page explains how to create and manage API keys, what each permission level allows, and how rate limiting and infrastructure controls protect the cluster.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/universeclouddev/Universe/llms.txt
Use this file to discover all available pages before exploring further.
Authentication Overview
Universe uses Ktor’sAuthentication plugin configured with the bearer scheme. Include the token in every HTTP request:
ApiKey record, validates the permission level required by the endpoint, and either allows the request or returns 401 Unauthorized.
An in-memory ApiKeyCache caches each token lookup for 15 seconds before re-querying the database. This avoids a database round-trip on every request while still propagating key deletions within a predictable window.
Permission Levels
API keys carry one of two permission levels defined in theApiPermission enum.
ALL
Full admin access to every endpoint, including instance creation and deletion, configuration management, template sync, and executing commands on instances.Keys with
ALL permission bypass rate limiting entirely — every request is accepted regardless of call volume.PUBLIC
Read-only access to status, listing, and informational endpoints. Write and lifecycle-control endpoints reject
PUBLIC keys with 401.PUBLIC keys are subject to a sliding-window rate limit: 100 calls per 60 seconds per key. Exceeding the limit returns 429 Too Many Requests.| Feature | ALL | PUBLIC |
|---|---|---|
| Instance create / stop / kill / restart | ✅ | ❌ |
| Instance list / info / logs | ✅ | ✅ |
| Configuration read/write | ✅ | ❌ |
| Template sync | ✅ | ❌ |
| Execute console commands | ✅ | ❌ |
| Rate limiting | Bypassed | 100 req / 60 s |
Managing API Keys
API keys are managed through thekey console commands. These commands are available in the interactive console and via POST /api/commands/execute.
Creating a Key
keyId is a human-readable label (e.g., ci-deploy, grafana-reader). The permission must be ALL or PUBLIC (case-insensitive). On success the full token is printed once:
Listing Keys
abcd...wxyz). Tokens are never returned in full from key list.
Deleting a Key
Rate Limiting
Rate limiting is applied at the route level using theRateLimiting Ktor plugin. The plugin reads the Authorization header directly — before the authentication interceptor runs — so it can act on requests before they reach any handler.
- Allowed response
- Rate-limited response
- Unauthenticated response
Requests within the limit are passed through normally. No additional headers are added to the response.
ALL keys bypass rate limiting entirely. Use them only for trusted automation (CI/CD pipelines, internal tooling). For read-only dashboards and monitoring systems, use PUBLIC keys so rate limits apply and a misbehaving client cannot affect cluster operations.CORS
CORS is enabled by default in the Ktor server, allowing browser-based clients and dashboards to call the REST API from any origin. For production deployments where the API should only be called from known front-ends, restrict the allowed origins in the Ktor CORS configuration.WebSocket Authentication
WebSocket endpoints (/api/instances/{id}/live-log and /api/console) require the same Bearer token as HTTP endpoints. The token must be provided in the Authorization header during the initial HTTP upgrade handshake.
Browser WebSocket clients (
new WebSocket(url)) cannot set arbitrary headers. In browser contexts, pass the token as a query parameter only if your deployment includes a reverse proxy that converts it to a header. Direct token exposure in URLs is not recommended for production use.Infrastructure Hardening
Best Practices
Key management
Key management
- Create one
ALLkey per automated system (CI/CD pipeline, internal orchestration scripts) and rotate it on a schedule. - Create separate
PUBLICkeys for monitoring, dashboards, and read-only integrations. These are rate-limited and cannot modify cluster state. - Delete keys for decommissioned systems immediately.
- Never commit tokens to source control. Use environment variables or a secrets manager.
Network isolation
Network isolation
- Place the Hazelcast port (
6000) behind a firewall that allows only Master ↔ Wrapper traffic. - Expose the REST API port (
7000) only to trusted networks or behind an authenticated reverse proxy. - Use Tailscale or a VPN for cross-datacenter clusters so neither the Hazelcast port nor instance ports need to be publicly routable.
Docker runtime
Docker runtime
- Mount the Docker socket read-only where possible, or use a Docker socket proxy (e.g., Tecnativa/docker-socket-proxy) that allows only the specific Docker API calls Universe needs.
- Do not run Universe as
rootinside the container unless required by the socket permissions on your host.