# 2s PubSub Subscribe

> 2s PubSub Subscribe is a paid API for AI agents from 2s.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Subscribe a callback URL to a pub/sub topic so that published messages are POSTed to your endpoint in real time

## Facts

- Endpoint: POST https://2s.io/api/pubsub/subscribe
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-pubsub-subscribe-1f0ae16d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_THLE0BuGmNm-MFAd0nJ65

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 2s-pubsub-subscribe-1f0ae16d -d '<json body>'
```

Example prompt: Subscribe my webhook at https://myapp.example.com/hooks/events to the topic ID topic_abc123 on 2s — tag it as 'order-updates' so I can track it, and make sure it echoes back the confirmation token to activate.

## When to prefer this

Use this endpoint when you need to reactively receive messages published to a 2s.io pub/sub topic at a webhook endpoint rather than polling. Ideal for event-driven agent workflows where low-latency delivery to your server matters and you have a publicly reachable HTTP/HTTPS callback URL. Requires a topic created via pubsub.create-topic.

## Known failure modes

- topicId does not exist — 404 or error indicating unknown topic
- callbackUrl is unreachable or does not echo the confirmation token — subscription remains inactive
- callbackUrl exceeds 2048 character limit — validation error
- label exceeds 64 character limit — validation error
- malformed callbackUrl (non-http/https scheme) — validation error
- insufficient USDC balance to cover $0.002 per-call fee — payment failure

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

Returns a subscription record including a confirmation token that the callback URL must echo back to activate the subscription. Once confirmed, any messages published to the topic will be POSTed to the registered callback URL with a signed body.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "label": {
   "type": "string",
   "maxLength": 64,
   "description": "Optional free-text tag."
  },
  "topicId": {
   "type": "string",
   "description": "The topicId to subscribe to (from pubsub.create-topic)."
  },
  "callbackUrl": {
   "type": "string",
   "maxLength": 2048,
   "description": "Where we POST published messages. Any http(s) URL; must echo the confirmation token to activate; body is signed."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-pubsub-subscribe-1f0ae16d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
