Delivery and store-and-forward

How much does a hosted relay cost?

A hosted relay costs whatever it takes to keep a server reachable, plus the bandwidth and storage for the messages it carries, and providers pass that on as a monthly plan, a rate per message or per delivery, or both. Self-hosting replaces the fee with your own server, bandwidth and operations time. Traffic that moves directly between nearby devices never touches the relay, so it adds nothing to the bill.

TL;DR

Relay costs come from an always-reachable server, bandwidth that crosses the network twice, storage for held messages and operations work. Before comparing prices, find out what one billable unit is, because a relay that counts deliveries charges a group message once per recipient. Relay only when no direct or local path exists, keep payloads small and expire uncollected messages.

Learning objectives

After reading this article you will be able to:

  • List the server, bandwidth, storage and operations costs of running a relay
  • Explain why the billable unit, messages or deliveries, matters when comparing relay prices
  • Identify ways to cut relay costs, from direct paths to message expiry

Relay server running costs

Whoever runs a relay server pays for the same few things, whether it is a company selling relay access or a team running its own: a server that is always reachable, bandwidth, storage and operations. A relay server is a machine on the internet that accepts messages from one device and passes them to another.

  • A server that is always reachable. Devices connect whenever they come online, so the relay cannot sleep. That means compute billed by the hour or month, plus redundancy if one machine going down should not stop delivery.
  • Bandwidth. Every relayed message crosses the provider’s network twice, once in and once out. Cloud providers bill data transfer by volume; Amazon’s EC2 price list, for example, prices data transferred in and out of a server per gigabyte.
  • Storage. A relay that holds messages for recipients who are offline is doing store-and-forward work, and those messages take disk space until they are delivered or expire.
  • Operations. Certificates, updates, monitoring, and limits that stop one abusive client from consuming everyone’s capacity.

The IETF’s specification for TURN, the standard for relaying traffic between hosts behind NATs, puts the trade-off plainly: relaying is very likely to work, but it comes at a high cost to the provider because the server needs a high-bandwidth internet connection. That is why TURN is meant to be used only when a direct path cannot be found.

Hosted relay pricing models

Hosted relay providers turn server, bandwidth, storage and operations costs into a price in a handful of ways, often combined:

  • A flat plan, with a monthly fee that includes an allowance of traffic.
  • A rate per message or per delivery beyond the allowance.
  • A charge per user or per connection, for services that tie relay access to signed-in accounts.
  • An admission or subscription fee. Nostr’s relay information document, NIP-11, lets a relay declare that it requires payment and publish a fee schedule with admission, subscription and per-publication fees.

The unit matters as much as the rate. A relay that counts deliveries rather than messages charges once for each recipient, so a message to a group costs more than a message to one person. Retries, acknowledgments and messages that never reach anyone may or may not count. Before comparing prices, find out exactly what one billable unit is.

Self-hosted relay costs

Self-hosting a relay replaces the per-message fee with your own server, bandwidth, storage and operations costs. TURN and Nostr are both openly specified, so you can run a TURN server for real-time traffic or a Nostr relay for signed events yourself. You choose the hardware, the region and the retention, and nothing is metered by a third party.

You also take on the work. RFC 8656 recommends that a TURN server limit both the number of allocations and the bandwidth each user can consume, and drop traffic beyond the quota, so a relay operator ends up writing and enforcing usage policy anyway. Availability becomes your problem too: if your relay is down, devices that depend on it cannot reach each other.

Reducing relay costs

  • Relay only when you have to. Interactive connectivity establishment (ICE) uses TURN as a last resort. The same idea applies to messaging: deliver over a direct or local path when one exists and fall back to the relay when it does not.
  • Keep payloads small. Bandwidth and storage scale with bytes, so send references or compact encodings rather than large blobs.
  • Expire what nobody will collect. A message TTL stops a relay storing messages for devices that have gone for good.
  • Watch the fan-out. Large groups multiply deliveries, so a per-delivery price grows with group size as well as message volume.

Offline Protocol hosted relay pricing

Offline Protocol publishes its hosted relay prices. The Free, Pro and Scale plans cost $0, $99 and $499 a month and include 10,000, 100,000 and 1M hosted relay deliveries a month respectively. Deliveries beyond the quota cost $0.50 per 1,000, and Enterprise volumes are set by contract. With a card on file, usage beyond the quota is billed at that rate, and you can set a billing limit on any meter; a Free organization without a card stops at its quota instead, and local mesh traffic is never metered or paused.

Its documentation defines a delivery as one message the hosted relay accepts for one recipient and then delivers or holds for delivery. A group message counts once for each member it reaches, and a retry of the same message counts once. Delivery acknowledgments and messages that reach no one are not counted. Messages that devices forward for each other over Bluetooth LE or another local transport never pass through the hosted relay and are never metered.

Each device authenticates to the relay with its signed-in user’s OfflineID session, and guest sessions are not accepted. OfflineID is billed by monthly active users, each end user who signs in at least once in the calendar month, which the same plans include at 1,000, 10,000 and 50,000 a month, with $0.02 per monthly active user beyond that. An estimate for an app that uses the relay should include both meters.

Frequently asked questions

Does a group message cost more than a direct message on a relay?

It often does when the relay prices per delivery, because the relay hands one copy to each recipient. Check whether a provider counts per message sent or per recipient reached before you estimate a bill.

Is it cheaper to run my own relay?

It removes the per-message fee, but you pay for the server, the bandwidth and the time to operate it, including updates, monitoring and abuse limits. Which is cheaper depends on your traffic and on how much operations work your team can absorb.

What counts as one hosted relay delivery on Offline Protocol?

Its documentation defines a delivery as one message the hosted relay accepts for one recipient and then delivers or holds for delivery. A group message counts once for each member it reaches, a retry of the same message counts once, and delivery acknowledgments and messages that reach no one are not counted.

Is local mesh traffic billed as hosted relay usage?

No. Messages that devices forward for each other over Bluetooth LE or another local transport never pass through the hosted relay and are never metered.

Why is relaying traffic through a TURN server expensive?

The TURN specification, RFC 8656, says relaying is very likely to work but comes at a high cost to the provider, because the server needs a high-bandwidth internet connection. That is why TURN is meant to be used only when a direct path cannot be found.

Can a Nostr relay charge for access?

Yes. Nostr's relay information document, NIP-11, lets a relay declare that it requires payment and publish a fee schedule with admission, subscription and per-publication fees.

Sources

Build it with Offline Protocol

The licensing and hosted services page defines what counts as a hosted relay delivery, lists each plan's quotas and overage rates, and explains what happens when a quota or billing limit is reached.

Read licensing and hosted services