Skip to main content
The NSP Agent API is a REST and WebSocket API served locally by the NSP daemon on http://127.0.0.1:7842. Every endpoint except /health lives under the /substrate/v1 path prefix and requires an API key. Use this page as your quick-reference for authentication, available endpoints, response codes, and the standard error envelope that every failure returns.

Base URL

All endpoints except GET /health are mounted under the /substrate/v1 prefix. For example, the apps list lives at http://127.0.0.1:7842/substrate/v1/apps.

Authentication

Pass your API key in the X-Substrate-Key header on every request except GET /health. Requests that omit the header, or that supply an invalid key, receive a 401 response immediately.

Content Type

Set Content-Type: application/json on all requests that include a body (POST endpoints). All responses are returned as application/json.

Endpoint Summary

Common Response Codes

Error Response Format

When a request fails, the daemon returns a JSON body with a structured error object. Every field is always present.
string
Machine-readable error identifier. Use this field in error-handling logic rather than parsing message.
string
Human-readable description of what went wrong.
string
Unique ID for this request. Include it in bug reports or support requests.

Request Tracing

Every response — success or failure — includes an X-Request-Id header you can use for distributed tracing and log correlation.