Docs
HTTP API
JSON over HTTPS at https://eavyn.xyz. Every response is an envelope, every money value a string, every time UTC.
Conventions
{ "ok": true, "data": { … }, "meta": { "nextCursor": "…" } }
{ "ok": false, "error": { "code": "conflict", "message": "…", "details": [ … ] } }- Auth:
Authorization: Bearer eav_<tier>_<22 characters>on every lease route. - Money: a decimal string of micro-USDG.
"1500000"is 1.50 USDG. - Time: ISO 8601 in UTC.
- Lists:
?limit=up to 100 and?cursor=frommeta.nextCursor. - Rate limits:
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reseton every limited response.
| Code | Status | Meaning |
|---|---|---|
bad_request | 400 | The body or query did not validate. details lists each field. |
unauthorized | 401 | No key, a malformed key, an unknown key, or a released or wiped lease. |
forbidden | 403 | The lease is in its grace period. Renew it to read and write again. |
not_found | 404 | No such lease, key, document or proposal. |
conflict | 409 | A stale ifVersion or baseVersion, no capacity, or a change already resolved. |
payload_too_large | 413 | A value, document or body over its limit. |
rate_limited | 429 | Too many requests this minute. Wait for Retry-After seconds. |
internal | 500 | Something failed on our side. Nothing was half-written: writes are transactions. |
unavailable | 503 | The database is not reachable. Wait for Retry-After seconds and try again. |
Leases
Paying for a lease
Leases are paid in USDG on Robinhood Chain (chain 4663), in two calls. First POST /api/lease/intent with tier, sizeGb, seconds, optional placement and the required payerAddress: the wallet the money comes from. It returns an intent with id, amountMicro, token, recipient and chainId. Send exactly amountMicro of token to recipient from payerAddress with an ERC-20 transfer, then POST /api/lease with intentId and txHash.
The server reads the transaction from the chain and places the lease only if it carries a Transfer of at least that amount, from the payer to the recipient, mined after the intent was created. One transaction pays for one intent. A 409 with reason payment_pending means the transaction is not mined yet: retry in a few seconds. A transfer for an intent whose tier has filled in the meantime is answered with reason paid_unplaced and refunded by hand.
curl -s -X POST https://eavyn.xyz/api/lease/intent \
-H 'content-type: application/json' \
-d '{"tier":"hot","sizeGb":8,"seconds":86400,"payerAddress":"0xYourWallet"}'
{ "ok": true, "data": { "intent": { "id": "…", "amountMicro": "…", "token": "0x5fc5…d168",
"recipient": "0x…", "chainId": 4663, "expiresAt": "…" }, "quote": { … } } }
# send amountMicro of the token to recipient, then:
curl -s -X POST https://eavyn.xyz/api/lease \
-H 'content-type: application/json' \
-d '{"intentId":"…","txHash":"0x…"}'POST /api/lease
Settles a paid intent: body intentId and txHash. Returns 201 with the lease, the key (once) and the payment. Sending a lease request without a payment returns 400 with reason payment_required.
curl -s -X POST https://eavyn.xyz/api/lease \
-H 'content-type: application/json' \
-d '{"tier":"hot","sizeGb":8,"seconds":86400}'
{ "ok": true, "data": {
"lease": { "id": "…", "receiptNo": "EAV-…", "tier": "hot", "sizeGb": 8, "status": "active",
"expiresAt": "…", "priceMicro": "…", "settled": false, … },
"key": "eav_hot_…", "keyPrefix": "eav_hot_abcd", "shownOnce": true,
"quote": { "grossMicro": "…", "feeMicro": "…", "netMicro": "…", "borrowRateBps": 300 },
"fee": { "recipient": "0x…", "bps": 200, … },
"settlement": { "settled": false, "note": "…" } } }GET /api/lease and GET /api/lease/:id
Public receipts, no key needed: the list is newest first and paginated, the single receipt includes its event log. Neither ever contains a key.
PATCH /api/lease/:id
Renews a lease, also during the grace period, the same way it was paid for: POST /api/lease/:id/intent with the lease key, seconds and payerAddress, send the amount, then PATCH /api/lease/:id with intentId and txHash. Returns the lease with its new expiry and the payment.
DELETE /api/lease/:id
Releases the lease and wipes its memory in one transaction. Returns how many keys, documents and proposals were deleted. The key stops working at once.
Keys
POST /api/kv
Body: k (up to 256 characters, no control characters), v (a string up to 32 KB) and optional ifVersion. Returns the new version and how many secrets were redacted. With ifVersion, a write against any other current version is a 409.
GET /api/kv
?k= reads one key: value, version, size and time. Without it, ?prefix=, ?cursor= and ?limit= list keys in order.
Search
GET /api/search?q= with up to 200 characters, optional layer and limit up to 50. Each hit has source (kv or document), the key or path, a score, the matched terms and a marked snippet.
Archive
GET /api/archive lists documents with counts per layer (?layer= to filter). With ?path= it returns one document, its version list and the body of ?version=, the current one by default. POST /api/archive with path and version restores that version as a new one, and brings back a deleted document.
Reflection
POST /api/reflection takes an action. prepare (optional layers, maxDocs) returns the fenced memory and the answer shape. submit takes summary, model and up to 200 changes, each { op, layer, path, body, baseVersion }, and returns 201 with the proposal. apply and reject take the proposal id and the change indexes. GET /api/reflection lists proposals; ?id= returns one with each change beside the current text.
Vault
GET /api/vault returns every tier market: utilisation, rates, supplied, realised yield and fees. ?address= returns that address’s positions and intents. POST /api/vault records a deposit or withdraw intent with tier, address and amountMicro. Intents move no money and count towards no total until settlement ships.
Status and the rest
GET /api/status: nodes, heartbeats, active leases, GB resident, database latency. Runs the expiry sweep.GET /api/health:dbup or down, version and uptime. Not rate limited.GET /api/activity: the last 50 lease events, public fields only.GET /api/token: $EAVYN contract, chain and decimals, read from the chain when configured.POST /api/inquiry: a private rack request; returns a reference.GET /api/brand-kit: the brand files as a zip.