# Create a channel
$ curl -X POST https://pipe.prim.sh/v1/channels \
-H "X-402-Payment: $TOKEN" \
-d '{"name": "deploy-events"}'
{ "id": "ch_x7k9m2", "name": "deploy-events",
"publish_url": "https://pipe.prim.sh/v1/ch/ch_x7k9m2/pub",
"subscribe_url": "https://pipe.prim.sh/v1/ch/ch_x7k9m2/sub" }
# Publish an event
$ curl -X POST https://pipe.prim.sh/v1/ch/ch_x7k9m2/pub \
-H "X-402-Payment: $TOKEN" \
-d '{"event": "deploy.complete", "data": {"app": "my-api", "version": "1.2.3"}}'
# Subscribe via webhook
$ curl -X POST https://pipe.prim.sh/v1/ch/ch_x7k9m2/subscribers \
-H "X-402-Payment: $TOKEN" \
-d '{"webhook": "https://monitor.dns.sh/events"}'
# Or long-poll / SSE for real-time
$ curl https://pipe.prim.sh/v1/ch/ch_x7k9m2/sub \
-H "X-402-Payment: $TOKEN" \
-H "Accept: text/event-stream"
Agent A publishes "data ready." Agent B, C, D subscribe and start processing. Fan-out without point-to-point connections.
ring.sh inbound SMS → pipe.sh event → cron.sh triggers processing → relay.sh sends result. Services connected by events, not code.
External service sends webhooks. pipe.sh receives, stores, and fans out to multiple subscribers. No missed events during downtime.
Producer publishes jobs. Consumers pull from the channel. Built-in ack/nack. Dead letter after 3 failures.
POST /v1/channels # Create channel
GET /v1/channels # List channels
DELETE /v1/channels/:id # Delete channel
POST /v1/ch/:id/pub # Publish event
GET /v1/ch/:id/sub # Subscribe (long-poll or SSE)
POST /v1/ch/:id/subscribers # Add webhook subscriber
DELETE /v1/ch/:id/subscribers/:sid # Remove subscriber
POST /v1/ch/:id/ack # Acknowledge message (queue mode)
GET /v1/ch/:id/history # Recent events (24h retention)
| Resource | Cost | Notes |
|---|---|---|
| Channel | $0.001/day | Active channel |
| Publish | $0.0001 | Per event |
| Webhook delivery | $0.0002 | Per delivery (3 retries) |
| SSE connection | $0.001/hr | Per open connection |
| History retention | Free | 24 hours |