> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuroencoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Neuroencoder is a hosted EEG embeddings API (https://api.neuroencoder.com/v1). The model runs only on its servers. Python package `neuroencoder` on PyPI: client and command line tool; it does not contain the model. Precomputed real outputs need no key: GET https://api.neuroencoder.com/v1/samples lists two samples from the public Sleep-EDF data (ODC-By 1.0, attribution required): a full night's embeddings with scored sleep stages, and a 10-minute EDF with its embeddings. An instant key needs no email: POST /v1/signup with {"instant": true, "accept_terms": true} accepts the API terms (https://docs.neuroencoder.com/terms) and returns a provisional key at once (2 h of EEG, 20 requests/min, at most 120 windows per request or job, 7 days) and a claim_url that a person can open to turn the same key into a trial key. GET /v1/models also needs no key. From nothing to your own file in five commands: https://docs.neuroencoder.com/quickstart. A trial key also comes from `neuroencoder login --email <address>` or the HTTP device flow (POST /v1/signup with "device": true, then POST /v1/signup/token); a person ticks the terms boxes and approves the emailed link once. Data use (https://docs.neuroencoder.com/data-use): a response with "data_use": "contribute" stored a de-identified copy of the signal that may train our models; a response without data_use, or with "zero_retention", kept no copy (jobs keep their upload until they end and their result for 7 days). Terms: https://docs.neuroencoder.com/terms. Privacy: https://docs.neuroencoder.com/privacy. Security and vulnerability reports (security@neuroencoder.com): https://docs.neuroencoder.com/security. Main endpoint: POST /v1/embeddings with an EDF, BDF, FIF or NPY file or a JSON array; any montage, any sampling rate; one 768-dimensional vector per window. Errors are JSON with a `fix` field. Versions (https://docs.neuroencoder.com/versioning): `neuroencoder-eeg` is an alias, `neuroencoder-eeg-2026-11` a dated snapshot that never changes; pin with `model` or the Neuroencoder-Model header; responses carry model, model_snapshot and pipeline_version; deprecations get at least 6 months' notice. Support: support@neuroencoder.com (best effort, reply within 3 business days); status: https://neuroencoder.com/status. Reference: https://docs.neuroencoder.com/api. Getting started without signing up: https://docs.neuroencoder.com/instant-keys. OpenAPI: https://api.neuroencoder.com/v1/openapi.json. Sleep staging: a whole-night PSG (.edf/.bdf, at least 2 h, at least one EEG channel with a 10-20 label at 100 Hz or more; EOG used when present) as a job with "task": "sleep_staging" (POST /v1/files, PUT, POST /v1/jobs, poll, download) returns W/N1/N2/N3/REM per 30 s epoch with probabilities, a low-confidence flag, summary metrics (TST, sleep efficiency, latencies, WASO) and a CSV; it counts nights per week (trial 3, instant 1), weeks start Monday 00:00 UTC. Model neuroencoder-sleep-2026-11, trained on 1,629 nights from eight public datasets licensed for commercial use. On nights it never trained on, Cohen's kappa with EOG is 0.755 on 44 Sleep-EDF telemetry nights and 0.687 on 128 BOAS nights (YASA's pretrained classifier on the same nights: 0.732 and 0.659), and 0.672 to 0.807 across eight leave-one-site-out folds. It is behind that reference on CAP and ANPHY, and slightly below on DOD (within the confidence intervals). Guide: https://docs.neuroencoder.com/sleep-staging. Benchmark: https://docs.neuroencoder.com/sleep-benchmark.

# Data use

> What happens to the EEG you send to the Neuroencoder API: zero retention or contribute, what a contributed recording keeps and what is removed, the Neuroencoder-Data header, and how to list and delete recordings.

Every account has a data use setting, which all its API keys follow: **Contribute** or **Zero retention**.

* **Zero retention.** We process the recording in memory to compute your result. We keep no copy of the recording or the embeddings after the response. Jobs are the exception while they run: a job keeps its upload until it ends and its result for 7 days (or until you delete the job). We also keep request metadata (see the [privacy notice](https://docs.neuroencoder.com/privacy.md)).
* **Contribute.** We also store a de-identified copy of the signal and may use it to develop, train and evaluate our models.

While recordings can be stored, every response says what happened to that request (`data_use` in the body and the `Neuroencoder-Data-Use` header), and `GET /v1/me` shows the setting. **If a response has no `data_use`, or says `zero_retention`, no copy of that recording was kept** (jobs keep their upload until they end and their result for 7 days).

## Which keys contribute

| Key | Data use |
| - | - |
| Free keys (trial and instant) issued after the holder accepted the [terms](https://docs.neuroencoder.com/terms.md) | Contribute. Cannot be switched to zero retention. |
| Paid and collaboration keys | Your choice. Zero retention until you choose Contribute. |
| Keys under a clinical or contract agreement that requires it | Zero retention, fixed. |
| Keys issued before the data use setting existed | Zero retention until you opt in. |

Accepting the terms: on the page the signup email links to, tick both terms boxes where the page shows them. From code, send `"accept_terms": true` with the token to `POST /v1/verify`. An instant key's signup call (`POST /v1/signup` with `{"instant": true, "accept_terms": true}`) accepts the terms; without `accept_terms` it is refused. Whoever claims an instant key ticks the boxes again.

Uploads with an instant key that nobody has claimed yet are held in quarantine: stored, listable and deletable like any other, but never used for training. When the key is claimed they become regular contributions; unclaimed, they are deleted 30 days after upload.

Contribute only recordings you are allowed to share for model training, for example under your participants' consent or your ethics approval. Do not contribute protected health information under HIPAA, or clinical data you cannot share. Use a zero retention key for those.

## What a contributed recording keeps

The upload is decoded in memory. Only this is stored:

* only the channels the model uses (those mapped to a scalp region), resampled to the model's 250 Hz, as 32-bit floats, and the number of samples; channels the model ignores (EOG, ECG, EMG, respiration, unnamed or unrecognised ones) and the original sampling rate are not kept,
* the channel names, from a standard list (10-20, 10-10 and 10-5 electrodes and pairs of them); no label text from the file is ever stored (a name not on the list becomes `ch0`, `ch1`, ...), and the scalp region of each channel,
* the unit (volts) for EDF, BDF and FIF files,
* a random `recording_id`, the account the key belongs to (the account id, not your email address), the data use setting, the terms version, the month of the upload and the model version.

Before anything is stored, each upload passes checks: it must look like EEG (not flat, an amplitude typical of EEG, a spectrum that is not white noise), and stay under a daily limit per account (128 MB of stored signal for instant keys, 1 GB for trial keys, 8 GB for others). If it fails, the request is still answered, nothing is stored, and the response says `"data_use": "contribute_rejected"` with `data_use_reason` (`flatline`, `amplitude`, `spectrum` or `daily_cap`). An exact copy of a recording your account already contributed is not stored twice: the response names the recording already stored (`recording_id`). Recordings of other accounts play no part in this, so a response never tells you whether anyone else uploaded the same signal. For this we keep, with each stored recording, a keyed fingerprint of its signal (an HMAC under a secret key, specific to your account, useless without that key). It is deleted with the recording, and otherwise kept at most 13 months.

Never stored: the file and its name, every EDF and BDF header text field (patient and recording identification, start date and time, equipment, transducer and filter text, reserved fields), annotations, any other field you send (for example age or diagnosis), and any hash of the file. Do not upload recordings with names or other identifiers inside the signal itself.

The recording's record keeps only the month of the upload. Our storage provider records when each object was written, and our request logs record request times (kept 90 days).

Contributed recordings are stored encrypted on Amazon Web Services in Frankfurt, Germany (AWS eu-central-1). Requests are processed in the United States (AWS us-east-1).

## Choose per account or per request

The setting is the account's, so one key cannot change it for all the others. A key asks, and the account owner confirms by email:

```bash theme={null}
curl https://api.neuroencoder.com/v1/me/data-use -H "Authorization: Bearer $NEUROENCODER_API_KEY" \
  -H "content-type: application/json" -d '{"data_use": "zero_retention"}'
```

The answer is 202 `{"object": "data_use_request", "status": "pending_confirmation", "data_use", "expires_at", "message"}` (200 with the current setting if nothing would change). The owner address on file gets a single-use link (valid 30 minutes); the change applies to every key of the account, for later requests, once the owner confirms on that page. `{"data_use": "contribute"}` works the same way, and the owner ticks the terms boxes on the page: the key holder's acceptance does not count for the account. Free accounts that contribute cannot switch back to zero retention themselves (403 `zero_retention_unavailable`); free accounts issued before the setting existed can opt in. Instant keys have no owner to confirm (403 `owner_required`): claim the key first. At most 5 requests per account per day; each emails the owner.

For one request on a paid or collaboration key, send the header `Neuroencoder-Data: zero-retention` on `POST /v1/embeddings` or `POST /v1/jobs`. It can only lower retention. On a free key that contributes it is refused with 403 `zero_retention_unavailable`, so a recording you cannot share is never stored by mistake.

```bash theme={null}
curl https://api.neuroencoder.com/v1/embeddings -H "Authorization: Bearer $NEUROENCODER_API_KEY" \
  -H "Neuroencoder-Data: zero-retention" -F file=@recording.edf
```

## See and delete your recordings

A contributed request returns a `recording_id`; a job returns it once it has succeeded.

```bash theme={null}
curl https://api.neuroencoder.com/v1/recordings -H "Authorization: Bearer $NEUROENCODER_API_KEY"            # ids, sizes, upload month
curl -X DELETE https://api.neuroencoder.com/v1/recordings/<recording_id> -H "Authorization: Bearer $NEUROENCODER_API_KEY"
curl -X DELETE https://api.neuroencoder.com/v1/recordings -H "Authorization: Bearer $NEUROENCODER_API_KEY"   # all of them
```

Deletion removes the stored signal and its record at once; there are no backup copies. Training runs that start after the deletion do not use it. Models trained before the deletion are not changed.

Recordings belong to the account: every key of it lists and deletes them, including a replacement key, a key added later, or a claimed instant key (an instant key claimed into an existing account brings its uploads into that account, where they stay in quarantine: never used for training, deleted 30 days after upload). Recordings stay when a key expires. To delete them after that, or to close your account, write to [max@neuroencoder.com](mailto:max@neuroencoder.com). Recordings are kept until you delete them or close your account, and at most 5 years after upload.

If you took part in a study and want your recording removed, ask the lab that recorded you: it can delete it by `recording_id`. You can also write to [max@neuroencoder.com](mailto:max@neuroencoder.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.