Operate

API keys

cmd
hev login

Club Kit issues one customer-facing hev_ key per machine or member via hev login (/cli/exchange) and Club Kit Settings. That single key authenticates both your team’s shared hev layer archive and your organization’s hosted /v1/inference/* access through hev kit.

One unified hev_ key

Club Kit keys use the hev_ prefix (hev_<32 base62 chars>) and are backed directly by Layer’s ApiKey lifecycle. There is no separate duplicate Kit auth secret registry to synchronize or revoke independently.

PrefixIssued byAccepted onNotes
hev_hev login (/cli/exchange) and Club Kit SettingsLayer storage, /v1/* API, and /v1/inference/*Unified key carrying both storage namespaces and org inference entitlement.
hvl_Legacy Layer key mintingLayer storage (and /v1/inference/* if entitled)Legacy Layer keys remain accepted by Layer without disruption.
hk_Legacy Club Kit key mintingNon-inference /v1/* routes only during migration windowReturns Deprecation: true and Sunset headers until LEGACY_HK_SUNSET_AT. Rejected on /v1/inference/*.

Hosted /v1/inference/* always requires a hev_ key. Running hev login upgrades an existing hk_ machine cleanly without affecting org data.

Protected org OpenRouter entitlement

Each organization’s hev_ keys carry a Layer entitlement, inference.<org-target>, that points to a server-only secretRef ({ name, key: "api_key" }) referencing that organization’s provisioned OpenRouter credential.

  • secretRef is never returned to clients. Normal Layer key metadata (GET /v2/keys* and unauthenticated /v2/keys/authenticate) strips secretRef. Only authorized Club Kit serving and provisioning components resolve it server-side (via authenticated /v2/keys/verify).
  • Zero secret exposure on API and telemetry surfaces. GET /v1/whoami, GET /v1/usage, server logs, session traces, and error responses never expose sk-or-v1-... keys, secretRef objects, or OpenRouter management hashes.
  • Zero global or factory fallback. If an organization is disabled, unprovisioned, suspended, or budget-exhausted, /v1/inference/* fails closed. Club Kit never falls back to another organization’s credential or a shared factory OpenRouter key.

Org OpenRouter budgets, resets, BYOK and /v1/usage

All authorized hev_ keys in an organization share one org-owned OpenRouter credential and budget. Budgets are admin-managed and never mutable by client keys.

Budget settings

Organization administrators configure OpenRouter limits with:

  • limit: spend cap in USD (for example, an illustrative admin-configured cap such as limit = 100).
  • limit_reset: reset cadence — "daily" at 00:00 UTC, "weekly" on Mondays at 00:00 UTC, "monthly" on the 1st of the month at 00:00 UTC, or null for a lifetime cap.
  • include_byok_in_limit: whether bring-your-own-key (BYOK) usage counts toward the org limit.
# Illustrative admin-configured org budget parameters (server-managed, not client config)
limit = 100
limit_reset = "monthly"
include_byok_in_limit = false

Reading usage with GET /v1/usage

GET /v1/usage separates Layer storage metrics from cached provider-reported inference usage rather than maintaining a duplicate Club Kit spend ledger:

  • Layer storage section: searches, stored_bytes, and retention.
  • Inference section (cached 30–60s from OpenRouter): limit, limit_remaining, limit_reset, include_byok_in_limit, usage, usage_daily, usage_weekly, usage_monthly, disabled, and synced_at, plus a stale freshness indicator when an upstream refresh is rate-limited or temporarily unavailable.
{
  "storage": {
    "searches": 420,
    "stored_bytes": 184549376,
    "retention": "90d"
  },
  "inference": {
    "limit": 100,
    "limit_remaining": 74.35,
    "limit_reset": "monthly",
    "include_byok_in_limit": false,
    "usage": 25.65,
    "usage_daily": 3.10,
    "usage_weekly": 11.40,
    "usage_monthly": 25.65,
    "disabled": false,
    "synced_at": "2026-11-24T12:00:00Z",
    "stale": false
  }
}

Lifecycle: rotation vs. revocation vs. org suspension

Key rotation, individual key revocation, and organization suspension are distinct operations with narrow blast radii:

ActionEffect on this hev_ keyEffect on sibling org hev_ keysEffect on org data & OpenRouter budget
Rotate a hev_ keyMints a new hev_ Layer ApiKey bound to the same inference.<org-target> entitlement and revokes the old hev_ key.Unchanged — sibling keys stay active.Preserves org trace/board data, the org’s OpenRouter credential, budget, and usage history.
Revoke a hev_ key (hev logout or key revoke)Immediately terminates access (401) to both Layer storage and /v1/inference/*.Unchanged — sibling keys stay active.Preserves org trace/board data and org OpenRouter budget.
Suspend an orgHosted inference stops immediately (403) locally first, then disables the org OpenRouter key upstream (disabled: true).Hosted inference stops (403) for every key in the org.Member hev_ keys are not destroyed; unsuspending restores access cleanly.

Migration from hk_ and clean rollback

Upgrade a machine from hk_ to hev_

Run hev login on the machine to mint a hev_ key and update [kit].key in ~/.hev/config.toml:

hev login

During the bounded migration window (until LEGACY_HK_SUNSET_AT), existing hk_ keys continue to work on non-inference /v1/* routes and return Deprecation: true and Sunset headers so automation can detect stale keys. Hosted /v1/inference/* does not accept hk_ keys; hev kit guides you to run hev login instead.

Clean rollback

If you need to stop using Club Kit hosted inference on a machine, roll back locally without affecting teammates or org budgets:

  • Revoke this machine’s key: run hev logout. Only this machine’s hev_ key is revoked; sibling keys and the org’s OpenRouter budget stay intact.
  • Switch hev kit to direct OpenRouter or Codex (unscoped mode): when [[foh.key_scopes]] is not configured, export OPENROUTER_API_KEY=sk-or-... for direct OpenRouter calls, or select a codex/... model backed by codex login.
  • Leave scoped multi-workspace mode: [[foh.key_scopes]] puts hev kit into exclusive scoped mode where only scope/<name>/<model> targets are registered (unscoped slugs and codex/... models are rejected while scopes remain configured). To roll back to unscoped [kit].key / HEV_API_KEY, direct OPENROUTER_API_KEY, or codex-sub, remove (or comment out) [[foh.key_scopes]] in ~/.hev/config.toml and restart hev kit. Rolling back never revokes sibling keys or mutates org OpenRouter budgets. See Scoped inference in hev kit.
esc