REST APIs
Overview
The three HTTP services behind KryptWarden, and the conventions they share.
| Service | Base URL | Used by |
|---|---|---|
| Spend API | https://api.kryptwarden.xyz | Dashboards and your own reporting |
| Facilitator & relayer | https://pay.kryptwarden.xyz | x402 sellers (/verify, /settle) and the SDK (/relayer/*) |
| Demo sellers | https://demo-apis.kryptwarden.xyz | Testing agents |
Conventions
- JSON in, JSON out. Send
Content-Type: application/jsononPOSTandPUT. Bodies are limited to 64 KB. - No API keys. The services are public on Testnet. Nothing they do needs your keys: reads come from the chain, and writes are either signed by an agent or harmless (labels).
- Errors come back as
{ "error": "message" }with a4xxor5xxstatus. - Amounts come as both
…Stroops(integer string, 7 decimals) and…Usdc(decimal string such as"3.00"). - Times are unix seconds, except
checkedAt, which is an ISO 8601 string. - CORS. Browsers can call the hosted services only from
kryptwarden.xyzorigins. Server-side calls work from anywhere. - Health. Every service answers
GET /healthwith{ "status": "healthy", ... }.
Is the data authoritative?
The Spend API's balances, policies and holds are read live from the contract on each request. Its ledger history comes from indexed contract events stored in Postgres. Use /reconcile to confirm the two agree.