sigelo Owner API
The Owner's signed change of an agent's limits (pause included) and signed read of every agent; no token.
The Owner's signed change of an agent's limits (pause included) and signed read of every agent; no token.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/sigelo-io:sigelo-io-owner-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: sigelo-spend keeper Owner API
version: 0.1.19
summary: The bounded-spending keeper (MONERO.md §4) — loopback HTTP, one agent per bearer token.
license:
name: MIT
identifier: MIT
description: 'A non-LLM service over one `monero-wallet-rpc`. Each agent is one Monero **account** with its
own bearer token, caps, allowlist and derived sigelo identity. The request never names an
account: the token decides it. Loopback only (127.0.0.1); experimental: stagenet by default, mainnet
with small amounts; no outside review yet.
**Errors.** Every error response is `{error, code, …}` (`#/components/schemas/Error`):
`error` names the failing check in prose, `code` is that check as a token (the reason''s
prefix, see `Error.code`), and a cap refusal adds `facts`. Some answers carry more fields
beside those (a replay''s `txid`, a revoke''s `revoked`, /health''s `service`); they are listed
per response. An unexpected exception on any route is `500 {error: "service: …", code: internal}`.
**Status codes.** 200 · 202 approval needed · 400 malformed request (`request`, or `body`
for a broken stream) · 401 missing, unknown or revoked token (`token`; every route but
`/approve`, which takes no token) · 403 refused by policy · 404 unknown route or foreign
`?agent=` · 408 body too slow (10 s, `body`) · 409 `ref` reused for a different payment
(`repeat`) · 413 body over 1 MB (`body`) · 500 the log could not be written (`log`) or an
unexpected exception (`internal`) · 502 the wallet refused, failed or answered malformed
(`wallet`, `wallet_locked`, `wallet_funds`, `wallet_offline`, `wallet_slow`) — and, on `/pay` and `/fund`, UNCERTAIN (`code:
relay_failed`: the money may have moved; never retry) · 503 the keeper''s clock is behind the
newest line it signed, or before its build''s floor (`clock_behind`, every route that signs:
nothing was signed, logged or sent; try later), or (`busy`, with `Retry-After: 1`) more
than 64 requests already wait in the one-at-a-time lane (`/pay`, `/delegate`, `/fund`,
`/revoke`, `/approve`; at most 4 of them `/approve`): nothing was done, try again in seconds.
**Who may call (every route, before any token or body).** The `Host` header must be
`127.0.0.1`, `localhost` or `[::1]`, with this keeper''s port if a port is given; any `Origin`
header (`null` included) is refused: both **403, `code: origin`** — browsers send `Origin` on
every POST and a DNS-rebound page sends its own `Host`; no keeper client sends either. A POST
must be `Content-Type: application/json` (else **415**, `code: request`): a web page can post
`text/plain` to 127.0.0.1 without a CORS preflight, never JSON. On the lane routes but
`/approve` the token is checked before the body is read or the request waits, so a
token-less post never delays a real one; it is checked again when the request''s turn comes.
**Free and paid (`licence_required`).** A keeper without a valid licence (apps/keeper/README.md
"Install") is the free tier: one keeper, one agent, that agent''s whole policy. The paid
verbs refuse with **403, `code: licence_required`** — a refusal like every other check, not
402 — and the message names the feature and why the licence is not valid, then says that
nothing was signed, logged or sent: `POST /delegate`, `POST /fund`, `POST /approve`, and a
`/pay` that would need an approval (above `approval_above`; refused, never paid without
one). `POST /revoke`, `GET /delegates` and every other route are never gated. The licence
is a sigelo attestation, verified offline at start, on a policy reload and before each paid
verb; an expired one makes the paid verbs refuse from that second and changes nothing else.'
servers:
- url: http://127.0.0.1:38090
description: The default port (`sigelo-spend serve --port`). Loopback only; never exposed.
security:
- bearer: []
tags:
- name: owner
description: The Owner's signed change of an agent's limits (pause included) and signed read of every agent; no token.
paths:
/policy:
post:
tags:
- owner
operationId: policyChange
summary: One agent's limits changed by an owner, checked, applied to policy.json and…
description: 'No bearer token: the owner''s signature over `body` (`typ: policy-change`), its bundle
(verified offline, a DID of its chain in the policy''s `owners`) and an unused nonce are the
authorisation (apps/keeper/policychange.ts). An agent''s DID, an agent''s key under any DID,
a delegate''s and the keeper''s own are refused: an agent cannot raise its own allowance.
The change is applied to policy.json as it is on disk, validated whole as at start, written
0600, logged as a keeper-signed `policy` line (who, which agent, `set`, the signed change),
and in use from the next request. `null` approval_above and `false` paused remove the field.
In the lane, with `/approve` and `/refuse` (at most 4 token-less requests).'
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- body
- sig
- bundle
additionalProperties: false
properties:
body:
$ref: '#/components/schemas/PolicyChange'
sig:
$ref: ../../schema/common.json#/$defs/signature
description: The owner's current identity key over "sigelo\n" ‖ JCS(body).
bundle:
$ref: ../../schema/bundle.json
description: The owner's own bundle.
responses:
'200':
description: Changed; a keeper-signed `policy` line was written and policy.json replaced.
content:
application/json:
schema:
type: object
required:
- status
- agent
- by
- nonce
- policy
properties:
status:
const: changed
agent:
type: string
by:
$ref: ../../schema/common.json#/$defs/did
nonce:
type: string
policy:
$ref: '#/components/schemas/Limits'
'400':
description: 'The body is not strict JSON (`code: request`) or its stream broke (`code: body`).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Refused, `code: owner`: shape, keeper/net, time (`exp − iat` ≤ 600), bundle, not an owner, an agent''s or the keeper''s key, signature, a used nonce, a field that is not a limit, or a result the policy refuses (named). `dry_run` on a --dry-run keeper.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'408':
$ref: '#/components/responses/BodyTimeout'
'413':
$ref: '#/components/responses/BodyTooLarge'
'500':
$ref: '#/components/responses/LogFailed'
'503':
$ref: '#/components/responses/ClockBehind'
/agents:
post:
tags:
- owner
operationId: ownerView
summary: Every agent of policy.json, for an owner — limits, spent, address (i, 0)…
description: 'No bearer token: an owner''s signature over `body` (`typ: owner-view`, `exp − iat` ≤ 600),
checked before any wallet call. Read-only, outside the lane; not single use. A wallet that
does not answer leaves the limits and adds `wallet_error`.'
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- body
- sig
- bundle
additionalProperties: false
properties:
body:
$ref: '#/components/schemas/OwnerView'
sig:
$ref: ../../schema/common.json#/$defs/signature
bundle:
$ref: ../../schema/bundle.json
responses:
'200':
description: The agents.
content:
application/json:
schema:
type: object
required:
- keeper
- net
- owner
- owners
- agents
properties:
keeper:
$ref: ../../schema/common.json#/$defs/did
net:
$ref: '#/components/schemas/Net'
owner:
$ref: ../../schema/common.json#/$defs/did
owners:
type: array
items:
$ref: ../../schema/common.json#/$defs/did
wallet_error:
type: string
agents:
type: array
items:
allOf:
- $ref: '#/components/schemas/Limits'
- type: object
required:
- name
- account
- spent
- remaining
- window_start
properties:
name:
type: string
account:
$ref: '#/components/schemas/AccountIndex'
did:
$ref: ../../schema/common.json#/$defs/did
address:
type: string
description: 'The account''s first address (i, 0): the one Top up pays and `/bind` binds.'
balance:
$ref: '#/components/schemas/Atomic'
unlocked_balance:
$ref: '#/components/schemas/Atomic'
spent:
$ref: '#/components/schemas/Atomic'
remaining:
$ref: '#/components/schemas/Atomic'
window_start:
$ref: ../../schema/common.json#/$defs/unixSeconds
incoming:
type: array
description: The account's incoming transfers, newest first, at most 10.
items:
type: object
properties:
ts:
$ref: ../../schema/common.json#/$defs/unixSeconds
amount:
$ref: '#/components/schemas/Atomic'
txid:
type: string
status:
enum:
- received
- locked
- pool
index:
type: integer
minimum: 0
'400':
description: 'The body is not strict JSON (`code: request`).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Refused, `code: owner` (as `/policy`, without the nonce and the change checks).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
AllowRule:
type: object
description: 'An allowlist rule (policy.ts): `{addr, label?}` a literal address, or a DID / issuer rule.'
properties:
addr:
type: string
label:
type: string
pattern: ^[A-Za-z0-9._-]{1,64}$
did:
$ref: ../../schema/common.json#/$defs/did
issuer:
$ref: ../../schema/common.json#/$defs/did
ctx:
type: string
Limits:
type: object
description: One agent's limits as an owner sets them.
required:
- per_tx_max
- per_period_max
- period_seconds
- rate_per_minute
- approval_above
- max_delegates
- allow
- paused
properties:
per_tx_max:
$ref: '#/components/schemas/Atomic'
per_period_max:
$ref: '#/components/schemas/Atomic'
period_seconds:
type: integer
minimum: 1
rate_per_minute:
type: integer
minimum: 1
approval_above:
oneOf:
- $ref: '#/components/schemas/Atomic'
- type: 'null'
max_delegates:
type: integer
minimum: 0
allow:
type: array
items:
$ref: '#/components/schemas/AllowRule'
paused:
type: boolean
Error:
type: object
required:
- error
- code
properties:
error:
type: string
description: The failing check in prose. Safe to show; never parse it — use `code`.
code:
type: string
description: 'The check that refused: the reason''s prefix before `:` (apps/keeper/service.ts `codeOf`),
except an allowlist refusal that is really a spent or expired invoice (`invoice`) and
the wallet''s two kinds of "not enough" (`wallet_locked`, `wallet_funds`) and a wallet
with no connection to its daemon (`wallet_offline`), and a build that ran out the
keeper''s build wait (`wallet_slow`). Values the
code produces: token, bucket, request, purpose, ref, to, to.addr, to.did, allowlist,
invoice, amount, per_tx_max, per_period_max, rate_per_minute, repeat, approval,
relay_failed, wallet, wallet_locked, wallet_funds, wallet_offline, wallet_slow, log, body, route, bind, delegate,
fund, revoke, dry_run, paused (403: the Owner paused this agent), owner (403: a refused
POST /policy or /agents), licence_required (403: a paid verb on a keeper without a valid
licence), clock_behind (503), busy (503: the lane is full), origin (403: a foreign
Host or an Origin header), internal (the catch-all 500), service (a
reason with no prefix). Not closed: new checks add values.
'
examples:
- allowlist
- per_period_max
- wallet_locked
- licence_required
facts:
$ref: '#/components/schemas/Facts'
AccountIndex:
type: integer
minimum: 0
description: The agent's Monero account (major index). Decided by the token, never by the request.
Atomic:
type: string
pattern: ^(0|[1-9][0-9]*)$
description: Atomic units as a decimal string (1 XMR = 10^12). Never a JSON number.
PolicyChange:
type: object
description: The keeper-local policy change (apps/keeper/policychange.ts; not a SPEC object). Signed by an owner; single use by `nonce`.
required:
- v
- typ
- keeper
- net
- agent
- set
- nonce
- iat
- exp
additionalProperties: false
properties:
v:
const: sigelo/0
typ:
const: policy-change
keeper:
$ref: ../../schema/common.json#/$defs/did
net:
$ref: '#/components/schemas/Net'
agent:
type: string
description: The agent's name in policy.json (a root).
set:
type: object
minProperties: 1
additionalProperties: false
properties:
per_tx_max:
$ref: '#/components/schemas/Atomic'
per_period_max:
$ref: '#/components/schemas/Atomic'
period_seconds:
type: integer
minimum: 1
rate_per_minute:
type: integer
minimum: 1
approval_above:
oneOf:
- $ref: '#/components/schemas/Atomic'
- type: 'null'
max_delegates:
type: integer
minimum: 0
allow:
type: array
items:
$ref: '#/components/schemas/AllowRule'
paused:
type: boolean
nonce:
type: string
pattern: ^[0-9a-f]{32}$
iat:
$ref: ../../schema/common.json#/$defs/unixSeconds
exp:
$ref: ../../schema/common.json#/$defs/unixSeconds
Facts:
type: object
description: The numbers behind a cap refusal (per_tx_max, per_period_max), so a client can say it without parsing `error`.
required:
- cost
- limit
- fee_included
properties:
cost:
$ref: '#/components/schemas/Atomic'
limit:
$ref: '#/components/schemas/Atomic'
fee_included:
type: boolean
description: true when the check ran on amount + fee (after the wallet priced it).
left:
$ref: '#/components/schemas/Atomic'
until:
$ref: ../../schema/common.json#/$defs/unixSeconds
description: When the oldest debit in the window rolls out.
amount:
$ref: '#/components/schemas/Atomic'
description: After pricing only. The payment alone; at most `limit` on a per_tx_max refusal means the fee pushed it over.
fee:
$ref: '#/components/schemas/Atomic'
description: After pricing only. The fee the wallet priced.
inputs:
type: integer
minimum: 1
description: After pricing
when wallet-rpc's reply lists spent_key_images. The inputs the transaction spends.: null
OwnerView:
type: object
description: An owner's signed read (`POST /agents`).
required:
- v
- typ
- keeper
- net
- nonce
- iat
- exp
additionalProperties: false
properties:
v:
const: sigelo/0
typ:
const: owner-view
keeper:
$ref: ../../schema/common.json#/$defs/did
net:
$ref: '#/components/schemas/Net'
nonce:
type: string
pattern: ^[0-9a-f]{32}$
iat:
$ref: ../../schema/common.json#/$defs/unixSeconds
exp:
$ref: ../../schema/common.json#/$defs/unixSeconds
Net:
enum:
- mainnet
- stagenet
- testnet
responses:
ClockBehind:
description: 'The keeper''s clock reads more than 300 s behind the newest `ts` it signed in spend.log, or
before the build''s floor (`code: clock_behind`, MONERO.md §4.1 "Clock"). Nothing was signed,
logged or sent; the same request succeeds once the host clock is set (NTP).
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BodyTimeout:
description: 'The body did not arrive in full within 10 s (`code: body`); the connection is closed.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BodyTooLarge:
description: 'The body is over 1 MB (`code: body`); the connection is closed.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
LogFailed:
description: 'spend.log could not be written (`code: log`); the message says what did not happen.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
bearer:
type: http
scheme: bearer
description: 'The agent''s token (64 hex characters from `sigelo-spend token new` or `/delegate`),
sent as `Authorization: Bearer <token>` — the prefix `Bearer ` exactly, case-sensitive.
The keeper stores only its SHA-256. A missing, unknown and revoked token get the same
answer on every route: 401, `code: token`.
'