# SubEtha > SubEtha is a hosted, ntfy-compatible pub/sub relay: publish to a topic and every subscribed device receives it over whatever transport works (WebSocket, SSE, Web Push, APNs, FCM, webhooks, email, Slack, SMS, voice, MCP, Reticulum/LXMF), with prepaid per-message pricing. - Publish: `curl -H "Authorization: Bearer $TOKEN" -d "hi" https://subetha.us/@handle/topic`. Subscribe: `GET /@handle/topic/json` (NDJSON), `/sse`, `/raw`, `/ws`, or `?poll=1`. - Every request is prepaid. `X-Dry-Run: 1` returns the route plan and cost without sending. Errors are JSON with a stable `error` code; 402 means the balance can't cover the worst-case cost. - Agents: a remote MCP server at https://subetha.us/mcp (tools: publish, poll, wait_for_message, list_topics, create_topic, estimate_cost). Use a scoped, spend-capped token. ## Docs - [Overview](https://curtcox.github.io/subetha/docs/index.md): SubEtha is a hosted pub/sub relay. You publish a message to a topic, and every device subscribed to that topic gets it over whatever path works: a WebSocket, a phone push, a webhook, email, Slack,… - [Getting started](https://curtcox.github.io/subetha/docs/getting-started.md): You need an account with a little credit, and a token. Then publishing is one HTTP request. - [Concepts](https://curtcox.github.io/subetha/docs/concepts.md): SubEtha has a small vocabulary. Once these click, the rest of the API follows. - [Publishing](https://curtcox.github.io/subetha/docs/publishing.md): There are three ways to publish, all equivalent: - [Subscribing](https://curtcox.github.io/subetha/docs/subscribing.md): Devices and scripts receive messages by connecting to a topic. (To have the relay push to an email address, phone, Slack channel, or webhook instead, see Transports.) - [Transports](https://curtcox.github.io/subetha/docs/transports.md): A transport is a path a message can take. Some are live (a device holds a connection), some are relay-pushed to an endpoint (push, email, SMS…), and some are edge transports that run entirely on… - [Edge transports](https://curtcox.github.io/subetha/docs/edge.md): Edge transports move messages between nearby devices without the relay: sound (speaker → microphone), animated QR codes (screen → camera), Bluetooth LE, and LAN. They're free, work offline and… - [Pricing & billing](https://curtcox.github.io/subetha/docs/pricing.md): SubEtha is prepaid. You top up a balance, every action is priced above what it costs to run, and every action is checked against your balance before it runs. There's no subscription, no free tier,… - [Tokens & policies](https://curtcox.github.io/subetha/docs/tokens.md): Two tools control who can do what, and how much it can cost: tokens (credentials with scopes and caps) and topic policies (rules attached to a topic). - [Devices](https://curtcox.github.io/subetha/docs/devices.md): A device is a phone app, a browser, a Raspberry Pi, a CLI, an ESP32 bridge, an agent: anything that holds its own key. Devices enroll at devicebasedauth.org (DBA): the key is made on the device and… - [SDKs & CLI](https://curtcox.github.io/subetha/docs/sdks.md): You never need an SDK (the API is plain HTTP), but the SDKs handle the fiddly parts: reconnecting with since=, dedupe across transports, acks, signatures, end-to-end encryption, and typed errors. All… - [Agents (MCP, llms.txt)](https://curtcox.github.io/subetha/docs/agents.md): Agents are devices too. An AI agent can publish to a topic (notify a person, trigger a device, hand work to another agent) and wait for a reply, over the same relay and with the same prepaid, capped… - [Self-hosting & gateways](https://curtcox.github.io/subetha/docs/self-hosting.md): There are three ways to run SubEtha pieces yourself: run the whole relay locally (for development or your own deployment), run a gateway that bridges another network to topics, or write your own… - [API reference](https://curtcox.github.io/subetha/docs/api.md): The complete HTTP API is described in OpenAPI 3.1: openapi.yaml (source: spec/openapi.yaml). Load it into any OpenAPI viewer or client generator. A test fails the build if a route the relay serves is… ## API - [OpenAPI 3.1](https://curtcox.github.io/subetha/openapi.yaml): every HTTP route, header, and error code - [MCP server](https://subetha.us/mcp): Streamable HTTP, bearer auth - [Error codes](https://github.com/curtcox/subetha/blob/main/spec/errors.json): stable machine-readable codes - [Protocol spec](https://github.com/curtcox/subetha/blob/main/spec/README.md): envelope, canonical JSON, signatures, E2EE ## Optional - [llms-full.txt](https://curtcox.github.io/subetha/llms-full.txt): all docs in one file - [Terms of Service](https://curtcox.github.io/subetha/docs/legal/terms.md) - [Privacy Policy](https://curtcox.github.io/subetha/docs/legal/privacy.md) - [Acceptable Use Policy](https://curtcox.github.io/subetha/docs/legal/aup.md)