Docs / Reference / Control API
Reference

Control API

The endpoints the panel uses.

The panel's API. Loopback only: the request must come from a loopback address with a localhost or 127.0.0.1 Host header and (if present) a localhost Origin; anything else gets 403. Never proxy /api/* to a network. JSON in, JSON out; errors are {"error":{"message":"..."}} with a 4xx/5xx status.

Source of truth: router/http/api.mjs and router/http/api-chain.mjs. If this page and the code disagree, the code wins.

The OpenAI-compatible endpoint (/v1/*) is documented in USAGE; the peer protocol (/p2p/*) in PROTOCOL.

bash
API=http://localhost:8545
curl -s $API/api/status

Node and market#

Method and path Body Returns
GET /api/status node (id, address, name, version, protocol, publicUrl, port), endpoint, balance, stats (24 h counters and 14-day series), network (peersLive, peersKnown, simPeers, models, listings, teeListings, liveListings, demoNetwork), providing, tee, policy
GET /api/models?q=text {models:[...]} every listing with score; q filters by model, peer or vendor
POST /api/route/preview {model} (default auto) {model, options: top 6 ranked, total}
GET /api/routes {routes:[...]} last 60 routes, newest first. Metadata only: model, peer, token counts, amounts. Never prompt text
PUT /api/settings {demoNetwork?: bool, name?: string} {settings, name}

Policy#

GET /api/policy {weights:{price,speed,reputation,privacy}, teeOnly, maxPrice}
PUT /api/policy any of weights (normalised), teeOnly (bool), maxPrice (number, or null/"" for no limit). Returns the stored policy

Peers and trust#

GET /api/peers {peers:[...]}
POST /api/peers {url}: fetches the peer's signed hello and adds it. 400 cannot add peer: ... on failure (protocol mismatch, unreachable, private URL without --allow-private-peers)
DELETE /api/peers/:id {ok:true}
POST /api/peers/refresh re-fetch all peers
GET /api/trust {allowedImages, allowedHw, issuer, audience}
PUT /api/trust allowedImages: array of sha256:<64 hex>; allowedHw: subset of GCP_AMD_SEV, GCP_INTEL_TDX; jwksInline is test-only and needs ELYRA_ALLOW_TEST_TRUST=1

Model sources (upstreams)#

GET /api/upstreams {upstreams:[{id,name,kind,baseUrl,hasKey,price,models,builtin}]} (keys are never returned, only hasKey)
POST /api/upstreams {name, baseUrl} required; apiKey?, price? (your cost, USD/MTok, default 0), models?. Without models the node lists them from <baseUrl>/models (400 if it cannot, or if the source reports none). In TEE mode only local sources are accepted
GET /api/upstreams/detect {found:[...]} probes localhost for Ollama (11434), LM Studio (1234), 8000, 8080
POST /api/upstreams/:id/refresh re-discover models from the source
DELETE /api/upstreams/:id remove (the built-in demo engine cannot be removed)

Providing#

GET /api/provide returns the provider config plus offered (models actually offered) and publicUrl. PUT /api/provide accepts any of:

Field Rule
enabled bool
upstreamId id from /api/upstreams; changing it clears models
models array of model ids; empty means all
price USD per million tokens, finite and >= 0
tee "none" or "claimed" only. claimed is self-declared and never counts as verified
maxConcurrent 1 to 64 (default 4)
creditUsd max unredeemed USD per consumer wallet (default 0.5)
autoRedeem, autoRedeemUsd auto-redeem on/off and threshold (default 0.25)
payout address that receives swept USDG, or ""
ratePerMin 1 to 10000 (default 120)
deny array of node ids to refuse (max 500)

Ledger and settlement#

GET /api/ledger {balance, funded, address, chain, mode: "sim"|"chain", entries, batches, stats}. Receipt signatures are truncated
POST /api/ledger/fund {amount?} adds simulated funds (default 10); simulated ledger only
POST /api/ledger/settle settle outstanding vouchers; returns {batches, failed}

Chain (escrow, USDG)#

GET /api/chain overview: configured network, escrow, token, balances, faucets, explorer links
PUT /api/chain {network?, rpcUrl?, chainId?, escrow?}; network must be a known one, escrow an address. Mainnet additionally needs the --allow-mainnet flag at boot
POST /api/chain/mint {usd} 0 < usd <= 10000; only works for the mock test token
POST /api/chain/deposit {usd} 0 < usd <= 100000; approve + deposit into the escrow
POST /api/chain/withdraw {action: "request"|"cancel"|"execute", usd?}; execute needs usd. 1-day delay, 7-day window

Chain failures return 502 with type: "chain_error".

Operations endpoints#

GET /healthz returns {"ok":true,"version","protocol","node","uptime","peersOnline"} and is safe to expose. GET /metrics (Prometheus, loopback only) never contains prompt text.