Keys & Auth

Three credential types, each with a different scope:

KeyPrefixPurposeHeader
API Keymk_Platform account (manage projects)X-API-Key
Admin Keysk_Project management (schema, config)X-Admin-Key
Public Keypk_Client-side data accessX-Public-Key
The admin key (sk_) is shown only once when you create a project. Save it immediately. If lost, rotate it via the dashboard. Never expose it in client-side code.

Alternative: Bearer token

All keys can also be passed as Authorization: Bearer {key}. MoonDB auto-detects the key type from the prefix.

Platform JWT

After login (POST /v1/accounts/login), you get a JWT. Use it as Authorization: Bearer {token} for platform operations (project management, billing). The JWT expires after 1 hour by default.