Skip to main content
The endpoints listed in this tab are generated from the live OpenAPI spec at api.pegana.xyz/openapi.json. Use the try-it-now panel on each endpoint to send a real request.
The OpenAPI spec is assembled from utoipa annotations on the axum handlers and covers the full /v1 surface (24 paths, enforced in CI). It’s the source of truth the first-party TypeScript and Python SDKs are generated from.

Base URL

Authentication

Every endpoint is public — no Authorization header, no API key. See authentication.

Rate limit

Per-IP sliding window: currently 240 requests a minute per IP on REST (see the RateLimit-Limit header). WebSocket allows 20 concurrent connections per IP. Liveness / readiness probes are exempt. Need more? Email rafael@pegana.xyz.

Cross-origin

CORS allowed from pegana.xyz, www.pegana.xyz, localhost:3000 by default. Self-hosted instances can extend via CORS_EXTRA_ORIGINS.

Errors

Standard HTTP codes. Error bodies carry a stable error code, usually as {"error": "...", "message": "..."}. Every code is listed in Errors.

SDKs

First-party typed clients — TypeScript (@peganahq/sdk-ts) and Python (pegana-sdk) — are generated from the OpenAPI spec above and cover every /v1 endpoint, plus a hand-written live-feed WebSocket helper (PegFeed / peg_feed).
Version 0.4.0 of both packages (@peganahq/sdk-ts on npm, pegana-sdk on PyPI, released 2026-10-25) is the current release. Earlier versions (npm 0.3.1, PyPI 0.3.0) predate the 2026-10-20 endpoint removals and still include /v1/alerts, /v1/auth/* and /v1/me/* calls, which return 404; upgrade to 0.4.0 to drop them.
Reads need no API key. Prefer your own client? Generating one from openapi.json is a first-class path — it’s exactly how the first-party SDKs are built (openapi-typescript + openapi-fetch for TypeScript, openapi-python-client for Python; orval also works).

Read one state

GET /v1/assets/:asset/state — the canonical read.

Stream live

wss://api.pegana.xyz/v1/ws: live push.