Overview
Authentication works differently depending on whether you use the hosted service or the self-hosted server.| Hosted Service | Self-Hosted | |
|---|---|---|
| Control API | nle_ Bearer token (required) | No auth by default |
| Device Protocol | HTTP Basic (device firmware) | HTTP Basic (device firmware) |
Self-Hosted: Control API (Port 8082)
The self-hosted control API (port 8082) has no authentication by default. Any client on your network can call it without credentials.
Optional: API Key Auth (via Reverse Proxy)
If you configure a reverse proxy with HTTP Basic Auth or a Bearer token header, the control API passes those headers through unchanged. The Python server itself does not validate them.Self-Hosted: Device Protocol (Port 8000)
Nest thermostats use HTTP Basic Auth on every request to the device protocol endpoints. The server extracts the device serial from the credentials — it does not validate passwords.d.{SERIAL}.{suffix}:
Hosted Service: API Key Authentication
Getting a Hosted API Key
- Go to https://nolongerevil.com/settings
- Click the API Keys tab
- Click Generate New Key
- Select scopes:
readand/orwrite - Copy the key immediately — it’s shown only once
API Key Format
Using a Hosted API Key
Include the key as a Bearer token:API Key Scopes
| Scope | Description |
|---|---|
read | View device status and settings |
write | Control devices (temperature, mode, fan, etc.) |
How are hosted API keys stored?
How are hosted API keys stored?
Keys are hashed using SHA-256 before storage. The plaintext key is never stored — only the hash.
What if my hosted key is compromised?
What if my hosted key is compromised?
Immediately revoke it in Settings → API Keys, then generate a new key and update your applications.
Summary
| Scenario | Auth Method |
|---|---|
| Calling the self-hosted control API from a script | None required |
| Thermostat connecting to self-hosted device protocol | HTTP Basic (serial extracted, password ignored) |
| Calling the hosted service API | Authorization: Bearer nle_... |
| Thermostat connecting to hosted service | HTTP Basic (managed by firmware provisioning) |