# Nostr Relay Health Check

> Nostr Relay Health Check is a paid API for AI agents from nostr.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Measures Nostr relay health by sending a genuine WebSocket REQ query and recording connection time, time-to-end-of-stored-events, and event count returned.

## Facts

- Endpoint: POST https://nostr.halowerk.com/relay-health
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nostr-relay-health-check-9ace6c3a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vnCK9VOwkXVd2tZ6Y-y8l

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nostr-relay-health-check-9ace6c3a -d '<json body>'
```

Example prompt: Can you run a deep health check on the Nostr relay at wss://relay.example.com — I need to know not just if it connects, but whether it's actually returning stored events and how long it takes?

## When to prefer this

Use this endpoint when you need to go beyond a simple reachability ping and verify that a Nostr relay is actually delivering stored events over WebSocket. It catches the critical silent-failure mode — a relay that accepts connections but never responds to REQ queries — which ping-based checks miss entirely.

## Known failure modes

- Relay refuses WebSocket connection — connection error returned
- Relay accepts connection but returns no events within timeout — silent failure detected
- Invalid or unreachable relay URL — network error
- Relay returns events but latency is extremely high — degraded performance flagged
- Malformed relay response — parsing error

## How this service works

Every relay is measured twice over. Over WebSocket a genuine REQ query is sent and the connection time, the time to end of stored events and the number of events returned are recorded — a relay that accepts the connection and then stays silent is the failure mode a reachability ping cannot see.

## Output

Returns connection time in milliseconds, time-to-end-of-stored-events, and the count of events returned — distinguishing genuinely healthy relays from those that accept connections but never deliver events.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "relays": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "maxItems": 12,
   "minItems": 1,
   "description": "wss relay addresses. Left empty, ten measured default relays are used."
  },
  "probe_kind": {
   "type": "integer",
   "default": 1,
   "maximum": 65535,
   "minimum": 0,
   "description": "Event kind used for the probe query."
  },
  "read_nip11": {
   "type": "boolean",
   "default": true,
   "description": "Also read the NIP-11 information document over https."
  },
  "timeout_ms": {
   "type": "integer",
   "default": 4000,
   "maximum": 6000,
   "minimum": 500,
   "description": "Time limit per relay in milliseconds."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nostr-relay-health-check-9ace6c3a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nostr.halowerk.com](https://www.zero.xyz/host/nostr.halowerk.com/llms.txt)
