> ## 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.

# Versions and deprecations

> How Neuroencoder versions its models, preprocessing and API: aliases and dated snapshots, how to pin them, what responses report, and how much notice you get before anything is retired.

Embeddings feed into analyses and papers, so you need to know which model produced them and to get the same vectors again later. We follow the practice of OpenAI and Anthropic for models (an alias that moves, dated snapshots that never change) and Stripe's practice for the API (a dated version you can pin in a header).

## Models: aliases and snapshots

| Id | Type | Task | Points to |
| - | - | - | - |
| `neuroencoder-eeg` | alias | embeddings | `neuroencoder-eeg-2026-11` |
| `neuroencoder-eeg-2026-11` | snapshot | embeddings | |
| `neuroencoder-sleep` | alias | sleep staging | `neuroencoder-sleep-2026-11` |
| `neuroencoder-sleep-2026-11` | snapshot (live since 16 November 2026) | sleep staging | |

* **A snapshot never changes.** The same snapshot with the same `pipeline_version` and the same input and options gives the same output, up to float32 rounding. Requests and jobs run on different CPUs, so results are not bit-identical: on one 5-minute EDF, the largest difference between a request and a job was 1e-7, and the lowest cosine similarity was 0.9999999.
* **An alias may move** to a newer snapshot, after the notice described below. Requests that name no model use the alias.
* `GET /v1/models` lists every id with its `type`, the `snapshot` an alias points to, and `deprecated_at` and `retires_at` for snapshots (both `null` until a deprecation is announced).

For results you will publish, name the snapshot: `neuroencoder-eeg-2026-11`, `pipeline_version` `2026-11-28`.

## Pinning a model

Send the id in the request body, or in the `Neuroencoder-Model` header:

```bash theme={null}
curl https://api.neuroencoder.com/v1/embeddings -H "Authorization: Bearer $NEUROENCODER_API_KEY" \
  -F file=@recording.edf -F 'metadata={"model": "neuroencoder-eeg-2026-11"}'

curl https://api.neuroencoder.com/v1/jobs -H "Authorization: Bearer $NEUROENCODER_API_KEY" -H "content-type: application/json" \
  -H "Neuroencoder-Model: neuroencoder-eeg-2026-11" -d '{"file": "file_...", "task": "embeddings"}'
```

* `POST /v1/embeddings` takes `model` in the JSON body or in `metadata`. `POST /v1/jobs` takes `model` next to `task`: an embeddings id for `embeddings`, a sleep-staging id for `sleep_staging`.
* The header applies to the request's task. The header ignores an id that belongs to the other task, so one header can pin your embeddings model without affecting sleep-staging jobs.
* If the body and the header name different models, the request fails with 400 `invalid_input`. An unknown or retired id returns 404 `model_not_found`.

## What responses report

| Field | Meaning |
| - | - |
| `model` | The id you asked for, or the default (`neuroencoder-eeg` for embeddings; `neuroencoder-sleep-2026-11` for sleep staging). Embeddings jobs carry it at the top level only when they pinned a model. |
| `model_snapshot` | The snapshot that computed the result. |
| `pipeline_version` | A date that identifies the preprocessing and inference code (filtering, resampling, channel mapping, the model code and the sleep-staging features). We change it whenever we change that code in a way that can change output. |

Embeddings responses, job results and the hypnogram file carry all three. `GET /healthz` and `GET /v1/models` report the current values.

## API version

The API version is a date. The current one is `2026-11-28`. Every response sends it back in the `Neuroencoder-Version` header. To pin it, send the same header:

```bash theme={null}
curl https://api.neuroencoder.com/v1/models -H "Neuroencoder-Version: 2026-11-28"
```

An unknown value fails with 400 `unsupported_api_version`. Without the header you get the current version.

* **No new version is needed for additive changes:** new endpoints, new optional fields or parameters, new response fields, new error codes on new paths, new models. Write clients that ignore fields they do not know.
* **Breaking changes get a new dated version:** removing or renaming a field, changing a type or a default, or making an optional parameter required. Requests that pin the older version keep the old behaviour until that version is retired.
* The number in the OpenAPI document (for example 2.7.0) is a release number of the service and its spec. The dated version moves only for breaking changes.

## Deprecation policy

* **Models:** we announce a snapshot's deprecation at least **6 months** before it is retired. In that time it keeps working, and `GET /v1/models` shows its `deprecated_at` and `retires_at`. An alias moves to a new snapshot only after the same notice, and the [changelog](https://docs.neuroencoder.com/changelog.md) says what changes.
* **API versions:** an API version is supported for at least **6 months** after the next one is published.
* **Notice:** every deprecation goes in the [changelog](https://docs.neuroencoder.com/changelog.md). We also email the owner of every account that used the deprecated model or version in the previous 90 days.
* **Security and law:** we may shorten notice when a model or version has to be withdrawn for a security problem or a legal obligation. If we do, we say so in the changelog.


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