NeccessoryNeccessory

API keys

Create a key, choose its mode, keep the secret safe and control what the key can do.

A key is a pair of values:

  • Key ID — public. Sent in the x-key-id header and safe to log.
  • Secret — private. Signs your requests. Shown once, when the key is created.

One key serves the SDKs and the REST API. Live keys start with nk_live_, test keys with nk_test_.

Key modes

ModeUse it forAvailability
cloudCloud measurements and video processing. Results are computed by Neccessory and billed in tokensEveryone. The default
testAutomated tests and CI. Synthetic results, never billedEveryone
on_deviceOn-device measurements in the browser: the key can create model grantsAfter your on-device access request is approved

The mode is set when you create the key and cannot be changed. For a different mode, create a new key.

Create a key

  1. Open Keys in the console and click New key.
  2. Choose the mode, and optionally a name and an expiry (365 days by default, or never).
  3. Choose the metric sets the key may request. Leave all selected to allow every set.
  4. Create the key and copy the secret. It is shown only once.

Keep the secret safe

  • Store the secret in your server's environment or secret manager.
  • Never put it in web pages, mobile apps or source control. Apps get short-lived session tokens or model grants from your server instead.
  • If a secret leaks, rotate the key at once.

Key settings

Each key has limits you can change at any time in the console:

SettingEffectError when it applies
Metric setsSets the key may request: hrv, bp, spo2, emotion, gaze403 feature_not_allowed
Requests per minuteLimit on all signed requests, from 1 to 6,000. Empty means no limit429 rate_limited
Monthly cloud secondsCap on seconds of cloud processing per calendar month (UTC)403 quota_exceeded
Monthly spend capCap on token spend per calendar month, entered in US dollars403 token_quota_exceeded
Model channelstable or beta models, for on_device keys—

Test keys ignore the cloud seconds quota and the spend cap. See Limits & quotas.

Rotate, disable, delete

ActionResult
RotateIssues a new secret. The old secret stops working immediately. This is also how you replace a lost secret
DisableBlocks the key without deleting it. Requests return 401 unauthorized
DeleteRemoves the key permanently

To change secrets without downtime, create a second key, deploy it, then disable the old one.

Test keys

A test key signs requests exactly like a live key but never runs a real measurement. Use it to test signing, session creation, polling, webhooks and result parsing in CI.

  • Results are synthetic and deterministic for each key. They carry "test": true.
  • A result becomes available about 2 seconds after the session or job is created.
  • Cloud sessions return wsUrl: null. In the Web SDK, use delivery: 'batch' with a test session.
  • Video jobs still need a real upload; the job then completes at once with a synthetic result.
  • hrv, bp and spo2 are filled when requested; emotion and gaze stay null.
  • Nothing is billed and no quotas apply. Model grants are not available.
  • The console hides test measurements unless you choose to show them.

On-device access

On-device mode puts the processing on the person's device. Apply for it in On-device in the console. The request asks for:

  • the platforms you need: web, iOS, Android;
  • your use case — where the measurement runs, what you are building and for whom;
  • your company name and, optionally, the expected monthly number of measurements;
  • two confirmations: on-device results are not attested and are not a basis for medical conclusions, and you will not extract or redistribute the models.

A concrete use case speeds up the review. You can have one open request at a time. The answer is approved, rejected or more information needed — in the last case, reply by email to support@neccessory.com. Access can later be revoked.

After approval, create new keys in On-device mode; existing keys keep their mode. While your request is reviewed, build on cloud mode — switching a web integration later changes one option.

Check a key

POST /sdk/v1/auth/test confirms that your signing works and returns the key's mode, limits and your token balance. See Authentication.