Authentication
DeLive's Open API requires a Bearer token. The server listens on 127.0.0.1 only, so other machines on your network cannot reach it.
Setup
- Go to Settings > General > Open API
- Toggle Enable Open API on
- A random token is generated for you; copy it, or click Generate Random Token for a new one
How It Works
- API disabled → all requests (except
/api/v1/health) return403 Forbidden - API enabled → requests must include the token; a missing or wrong token returns
401 - API enabled, token field cleared → every request returns
401until a token is set - Request with a non-local
Hostheader →403(blocks DNS-rebinding pages) - WebSocket with a web-page
Origin→403on/ws/liveand the provider proxies; only DeLive's own windows and local clients that send noOriginare accepted
Upgrading
Versions before 2.3 accepted requests without a token when the token field was empty. If you had the API enabled that way, DeLive now generates a token on startup: copy it from Settings into your MCP or script configuration.
REST API
Include the token in the Authorization header:
bash
curl -H "Authorization: Bearer dlv_your_token_here" \
http://localhost:23456/api/v1/sessionsWebSocket
Two authentication methods:
Query parameter (for clients that cannot set headers):
ws://localhost:23456/ws/live?token=dlv_your_token_hereAuthorization header (works in most WebSocket libraries):
javascript
const ws = new WebSocket('ws://localhost:23456/ws/live', {
headers: { Authorization: 'Bearer dlv_your_token_here' }
})MCP Server
The MCP server reads the token from the DELIVE_API_TOKEN environment variable:
json
{
"mcpServers": {
"delive": {
"command": "node",
"args": ["/path/to/DeLive/mcp/delive-mcp-server.js"],
"env": {
"DELIVE_API_TOKEN": "dlv_your_token_here"
}
}
}
}Error Responses
| Status | Body | Meaning |
|---|---|---|
403 | { "error": "API is disabled..." } | Open API is turned off in Settings |
401 | { "error": "Unauthorized" } | Missing or invalid token |
WebSocket connections with invalid authentication are rejected during the HTTP upgrade with the same status codes.