Skip to main content
By default, the NSP daemon requires every API request to carry a valid API key in the X-Substrate-Key header. This prevents other processes on the same machine — or any local web page — from querying your application state or triggering actions without your authorization. Keys are stored as one-way hashes, so the plaintext secret never persists on disk anywhere other than your own secure storage. Authentication is enabled by default and should remain enabled in any environment beyond your local development machine.

Generating an API Key

Run the following command to generate a new key and register it instantly:
The daemon prints the key to stdout and appends its hashed form to axon_keys.json. The key is active immediately — no restart required.
Copy the key from this output and store it in a secrets manager or environment variable. The daemon stores only the hash — it cannot reconstruct the plaintext key later.

Using the API Key

Pass your key in the X-Substrate-Key header on every request.

Keys File Format

The daemon reads keys from the JSON file configured in axon.toml under auth.keys_file (default: C:\ProgramData\Nelieo\axon_keys.json). You can inspect this file to see all registered keys:
id
string
A unique identifier for this key entry, generated automatically by keygen.
key_hash
string
A one-way hash of the plaintext API key. The daemon verifies each incoming request against all entries with enabled: true. The plaintext key is never stored on disk.
label
string
A human-readable name for this key. Set it to something that identifies the agent or system using it — for example, "ci-runner" or "production-agent-v2".
created_at
string
ISO 8601 timestamp of when the key was generated.
last_used_at
string
ISO 8601 timestamp of the most recent successful request using this key. Updated after each authenticated request.
enabled
boolean
Set to false to revoke a key without deleting it. The daemon rejects requests from disabled keys with a 401 disabled_key response.
To revoke a key immediately, open axon_keys.json and set "enabled": false on the relevant entry. The daemon picks up the change on the next request — no restart needed.

Enabling Auth in axon.toml

Authentication is enabled by default. The relevant section of axon.toml is:
To point the daemon at a different keys file — for example, a per-user file at %APPDATA%\Nelieo\keys.json — update keys_file and restart the daemon.

Authentication Errors

When a request fails authentication, the daemon returns HTTP 401 with a JSON body that identifies the specific failure reason. A missing_key response looks like this:
An invalid_key response:

Disabling Auth for Development

To run without key validation during local development, set require_key = false in your config or pass the environment variable:
The daemon prints the following warning at startup and repeats it every 60 seconds while auth is disabled:
For a full treatment of production security practices — network binding, key rotation, and least-privilege service accounts — see the API Keys security guide.