API keys
Create a key, send it with each request, keep it secret and revoke it when you no longer need it.
Every call to https://api.neuronlens.com/v1 is made with an API key that belongs to your account.
Create a key
- Sign in at neuronlens.com and open Profile → API keys.
- Name the key after where it will run, for example
staging-gateway. - Click Generate key and copy the key straight away.
A key is nl_ followed by 64 characters. It is shown once. NeuronLens stores only a hash of it, so a lost key
cannot be recovered; create a new one instead.
Send it with each request
Send the key in the X-API-Key header:
export NEURONLENS_API_KEY=nl_...
curl https://api.neuronlens.com/v1/me -H "X-API-Key: $NEURONLENS_API_KEY"
Authorization: Bearer nl_... is also accepted, for clients that only send bearer tokens. GET /v1/me returns
your account and today's usage and does not count as a run.
Keys share one allowance
The daily allowance belongs to your account, not to a key. Every key you create draws on the same 10 runs a day per product, and a new key does not reset it.
Keep keys secret
- Store keys in an environment variable (
NEURONLENS_API_KEY) or a secret manager, not in source code. - Call the API from your server. Do not ship a key in browser or mobile code.
- Use one key per service, so you can revoke one without touching the others.
Revoke a key
Delete the key under Profile → API keys. Requests with it stop working within a minute.
Related
- Authentication: base URL, headers and request format.
- Errors:
missing_key,invalid_keyand every other error.