Authentication & API keys
Create and use Algenta API keys. Mint a key, send it as a Bearer token, and confirm an authenticated request succeeds.
This page is the complete reference for authenticating to Algenta. It covers the API key you send on every request, how to mint bounded keys and revoke them, how the CLI stores credentials, how device binding protects capped keys, the hosted sign-up and login endpoints, and how to bring your own provider keys (BYOK). Every command, header, environment variable, and endpoint below is copied from the running engine and SDKs, so you can paste it directly.
How authentication works
Algenta authenticates every protected request with a single API key. The key identifies your organization, your plan, and (for capped keys) the device making the call. The engine resolves the key on each request and rejects anything that is missing, invalid, expired, or revoked.
There are two credential surfaces:
API keys — long-lived secrets that authorize machine-to-machine calls (
Authorization: Bearer <key>). This is what the SDKs, the CLI, and your services use.Hosted session tokens — short-lived JWTs returned by
POST /v1/auth/login, used by the dashboard and the sign-up flow. They are also accepted asAuthorization: Bearer <jwt>.
The same Bearer header carries either credential. The engine figures out which one you sent.
The API key
An Algenta key looks like de_live_... (or de_test_... for test keys). It is a bearer secret — anyone holding it can act as your organization, so treat it like a password.
Sending the key
Send the key as a Bearer token. This is the canonical header and the one the SDKs use. For older clients the engine also accepts X-API-Key.
curl https://api.algenta.ai/v1/me \
-H "Authorization: Bearer $ALGENTA_API_KEY"curl https://api.algenta.ai/v1/me \
-H "X-API-Key: $ALGENTA_API_KEY"Environment variables
The SDKs and CLI read the key and base URL from the environment.
ALGENTA_API_KEY
Your API key
DE_API_KEY (legacy)
ALGENTA_BASE_URL
API base URL (override for self-hosted)
DE_BASE_URL, ALGENTA_API_URL
Using the key from the SDKs
Both SDKs resolve the key from the constructor argument first, then ALGENTA_API_KEY, then DE_API_KEY. They attach Authorization: Bearer <key> to every request automatically. Install the TypeScript package from npm as algenta-sdk.
Managing API keys
Your first key is your bootstrap key — created with your account at sign-up and shown once. Use it to mint bounded replacement keys: scoped, labeled keys with an optional expiry and device cap. Rotate by creating a new key, moving your traffic to it, then revoking the old one.
List keys
The response lists active keys with their prefix, label, device limit, and timestamps. Key material is never returned — only key_prefix (the first 12 characters) so you can identify a key.
Create a bounded key
POST /v1/api-keys accepts a label and, optionally, an expiry and a device limit. Creating a key requires at least the member role.
label
string
Human-readable name shown in lists and audit logs.
expires_at
RFC 3339 timestamp, optional
After this time the key returns 401 invalid_api_key.
device_limit
integer, optional
Max distinct devices that may bind to this key. 0 = unlimited. Validated against your plan.
The response includes raw_key — the full secret.
Example create response
Revoke a key
Revocation is immediate and audited. Two guards apply:
You cannot revoke the last active key (
400 cannot_revoke_last_key). Create a replacement first.Revoking a key that does not belong to your org returns
404 api_key_not_found.
Rotate a key safely
CLI authentication
The self-hosted control-plane CLI is invoked as de. It reads ALGENTA_API_KEY first and otherwise uses the operating-system credential store. Non-secret settings remain in ~/.de/config.json; API keys are never written there. The self-hosted installer creates the wrapper; algenta-sdk does not install it.
Log in (register this machine)
de login registers the current machine under your API key, obtains a signed device license, and stores it locally.
Log out
Save a key without registering a device
de config set-key writes the key to the operating-system credential store and writes only an optional base URL to the CLI config. If the host has no secure credential backend, the command fails closed; use ALGENTA_API_KEY in the process environment. Use this command for plain API access when you do not need a local device license.
Manage keys from the CLI
Device binding (capped keys)
When a key has a finite device_limit, the engine binds it to specific machines. Each machine must present a stable device identity; a different machine reusing the same device id is treated as a clone and rejected. This is what prevents one capped key from being shared across an unbounded fleet.
From the SDKs and CLI
The SDKs and CLI handle binding for you. They derive a stable device id from the machine, send the device headers automatically, and store the binding token they receive so subsequent calls succeed. There is nothing to configure.
The headers they send:
X-Algenta-Device-Id
Stable per-machine id (16–64 chars).
X-Algenta-Platform
OS family, e.g. Darwin, Linux.
X-Algenta-Platform-Version
OS release string.
X-Algenta-Hostname-Hash
Salted hash of the machine fingerprint.
X-Algenta-SDK-Version
SDK / client version.
From raw HTTP
If you call the engine directly with a capped key, you must send the device headers yourself. On the first request that binds a device, the engine returns an X-Algenta-Device-Binding-Token response header. Replay that token on every subsequent request from the same device.
Device binding error reference
Binding fails closed. The errors you may encounter:
403 device_identity_mismatch— reusing a device id with a different fingerprint.401 device_binding_required— missingX-Algenta-Device-Id.401 device_binding_token_required— the device is already bound; replay the token.403 invalid_device_binding_token— the supplied token does not match.402 device_limit_reached— the key's device slots are full; revoke a device or create a broader key.
Manage devices
Hosted sign-up and login
The hosted control plane exposes a self-serve auth router under the /v1/auth prefix. These endpoints issue and reset credentials; they do not require an existing API key.
Sign up
Creates an organization, a user, and a first API key in one step. The raw API key is shown once in the response.
Log in
Returns a JWT bearer token. Use it as Authorization: Bearer <token>.
Verify email, forgot, and reset password
Verify, forgot-password, and reset-password requests
The verification and reset emails link to these same endpoints on your engine's public API URL (ALGENTA_API_PUBLIC_BASE_URL when set), never to the host a request happened to arrive on. Opening the verification link verifies the address; the reset link carries the token that POST /v1/auth/reset-password takes together with the new password.
/v1/auth/signup
POST
Create account + org + first API key.
/v1/auth/login
POST
Exchange credentials for a session JWT.
/v1/auth/verify
GET
Verify an email address from the link token.
/v1/auth/forgot-password
POST
Send a password reset email.
/v1/auth/reset-password
POST
Complete a password reset.
BYOK: provider keys
Bring-your-own-key lets your organization supply its own LLM provider credentials (and an optional Algenta engine key) instead of using managed billing. Keys are write-only: accepted on POST, stored encrypted at rest, and never returned by any endpoint. Managing provider keys requires the admin role.
Set or rotate a provider key
backend
string
Provider backend, e.g. anthropic, openai, google_genai, or engine for the Algenta engine key.
api_key
string
The provider/engine secret. Stored encrypted; never returned.
List configured backends
Returns the configured backends and when each was last updated — no key material.
Delete a provider key
Quick reference
Send a key
Authorization: Bearer de_live_... (or legacy X-API-Key)
Set the key for SDK/CLI
export ALGENTA_API_KEY=... (fallback DE_API_KEY)
Set a self-hosted base URL
export ALGENTA_BASE_URL=... (fallbacks DE_BASE_URL, ALGENTA_API_URL)
List / create / revoke keys
GET /v1/api-keys, POST /v1/api-keys, DELETE /v1/api-keys/{key_id}, or de keys list|create|revoke
Register / log out a machine
de login / de logout
Save a key without binding
de config set-key <key> [base_url]
List / revoke devices
de devices list|revoke, or /v1/device/list, DELETE /v1/device/{id}
Hosted auth
POST /v1/auth/signup, /v1/auth/login, GET /v1/auth/verify, POST /v1/auth/forgot-password, /v1/auth/reset-password
BYOK provider keys
GET /v1/provider-keys, POST /v1/provider-keys, DELETE /v1/provider-keys/{backend} (admin; needs ALGENTA_CONFIG_ENCRYPTION_KEY)
Related pages
QuickstartCLI referenceAPI endpoint referenceLicensing & editionsLast updated
Was this helpful?