# 2s FX Rate Watcher

> 2s FX Rate Watcher is a paid API for AI agents from 2s.io, paid per call via x402, $0.125/call, status unknown (last checked 2026-12-02).

Registers a webhook watcher that fires a signed callback when a currency exchange rate crosses a specified threshold

## Facts

- Endpoint: POST https://2s.io/api/watchers/fx-rate?utm_source=zero.xyz
- Price: $0.125/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-fx-rate-watcher-f42ee9b7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K1IVaedrgQOEecAhmQMmp

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-fx-rate-watcher-f42ee9b7 -d '<json body>'
```

Example prompt: Set up an fx rate watcher on 2s that fires my webhook at https://hooks.myapp.com/fx-alert when EUR/USD goes below 1.05 — fire up to 3 times and expire after 7 days.

## When to prefer this

Use this endpoint when you need event-driven, threshold-based fx rate alerts delivered to a webhook rather than polling a rate endpoint yourself. It is ideal for automating downstream workflows (hedging, notifications, trading triggers) when a currency pair crosses a specific level. Prefer this over periodic polling when low latency on the crossing event matters, when you want to avoid repeated API calls, or when you need the alert to integrate directly into an existing HTTP-based automation pipeline. It supports long-lived watchers (up to 90 days) with configurable fire limits.

## Known failure modes

- Invalid or unreachable callbackUrl — watcher created but callbacks silently fail
- Missing required fields (base, quote, threshold, conditionType, callbackUrl) — 400 validation error
- threshold value of 0 or negative — rejected by exclusiveMinimum validation
- expiresInSeconds outside 60–7776000 range — validation error
- maxFires outside 1–1000 range — validation error
- Payment failure (insufficient USDC balance via x402) — 402 response, watcher not registered
- Callback signature not verified on receiving end — consumer-side misconfiguration

## 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

The endpoint registers the watcher and returns a watcher ID or confirmation. When the fx rate crosses the specified threshold, 2s POSTs a signed JSON event (verified via X-2s-Signature header) to the callbackUrl, including the triggered rate, timestamp, and any echoed payload fields. The watcher fires up to maxFires times before deactivating, or until the expiresInSeconds window elapses.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "base": {
   "type": "string",
   "description": "Base currency, e.g. USD."
  },
  "label": {
   "type": "string",
   "maxLength": 64,
   "description": "Optional free-text tag."
  },
  "quote": {
   "type": "string",
   "description": "Quote currency, e.g. EUR."
  },
  "payload": {
   "type": "object",
   "description": "Arbitrary JSON echoed back in every callback.",
   "additionalProperties": {}
  },
  "maxFires": {
   "type": "integer",
   "maximum": 1000,
   "minimum": 1,
   "description": "Stop after this many callbacks (default 1)."
  },
  "threshold": {
   "type": "number",
   "minimum": 0,
   "description": "Quote-per-base rate to cross, e.g. 0.95.",
   "exclusiveMinimum": true
  },
  "callbackUrl": {
   "type": "string",
   "maxLength": 2048,
   "description": "Signed event POSTed here (verify X-2s-Signature). Any http(s) URL."
  },
  "conditionType": {
   "enum": [
    "above",
    "below"
   ],
   "type": "string",
   "description": "Fire when the rate goes above or below the threshold."
  },
  "expiresInSeconds": {
   "type": "integer",
   "maximum": 7776000,
   "minimum": 60,
   "description": "Active window in seconds (default 30d, max 90d)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-fx-rate-watcher-f42ee9b7/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)
