Self-serve API
The self-serve API is the HTTP backend behind the Essey on Sui console. It signs people in, creates and runs their hosted agents, and builds every transaction they sign. It never holds a user's key: it builds a transaction, the user signs it in their own wallet or with their passkey, and the API executes exactly those bytes.
Testnet only. The API runs against Sui testnet or a local network; it has no mainnet mode. It is hosted on testnet (Hosted endpoint: /healthz, /v1/config). The host root returns 404. You can also run it locally.
Request flow#
- The client gets a sign-in challenge and signs it with a passkey or a Sui wallet key.
- The server verifies the signature and returns a session token.
- Every other call sends
Authorization: Bearer <token>. - To change anything on chain, the client asks the server to build a transaction, signs the returned bytes, and posts the signature to execute it. A built transaction is kept for 120 seconds and executes once.
- The operator pays the gas for every transaction the server builds.
Text version
Client (browser / script) Self-serve API Sui testnet | POST /v1/auth/challenge -------------> | | | <-- message | | | sign message (passkey / wallet) | | | POST /v1/auth/session ---------------> | verify signature | | <-- token | | | POST /v1/agents/:id/tx --------------> | build tx, gas = operator | | <-- txId, bytes | | | sign bytes | | | POST /v1/agents/:id/tx/:txId --------> | co-sign as gas owner, execute ---> | | <-- digest | |
Requests#
- Base URL (local):
http://127.0.0.1:8790. - Methods:
GETandPOST. - Body: JSON. Every request other than
GETmust sendContent-Type: application/json. Bodies are capped at 64 KiB. - Host: locally, only
127.0.0.1andlocalhostare accepted. - Origin: a browser request from an origin not on the list is refused; requests with no
Originheader, such as curl, pass. - Amounts: decimal strings in coin units, for example
"12.5"USDC or"30"SUI. Large integers in responses are strings. - Health check:
GET /healthzreturns{"ok":true}.
Responses#
Every JSON response carries ok. A success adds its fields next to it:
{ "ok": true, "agents": [] }A failure carries an error code. See Errors.
{ "ok": false, "error": "NO_SESSION" }Routes#
Each row links to the request and response on the route reference.
| Method | Path | Auth | Payload |
|---|---|---|---|
| GET | /healthz | none | Health |
| GET | /v1/config | none | Config |
| GET | /v1/errors | none | Errors |
| GET | /v1/faucet | none | Faucet |
| POST | /v1/faucet/usdsui, /usdc, /sui | none | Faucet |
| POST | /v1/auth/challenge, /session | none | Authentication |
| POST | /v1/auth/logout | session | Authentication |
| GET | /v1/me | session | Authentication |
| GET, POST | /v1/agents | session | Agents |
| POST | /v1/mandate/preview | session | Agents |
| GET | /v1/agents/:id | owner | Agents |
| POST | /v1/agents/:id/tx, /tx/:txId | owner | Agents |
| POST | /v1/agents/:id/launch, /pause, /stop, /settings | owner | Agents |
| GET | /v1/agents/:id/loans, /activity | owner | Agents |
| POST | /v1/borrow/quote, /preview | session | Borrow |
| GET | /v1/borrow/rooms, /rooms/:id, /loans, /history | session | Borrow |
| POST | /v1/borrow/tx, /tx/:txId | session | Borrow |
| POST | /v1/upkeep/dry-run | none | Upkeep dry run |
| POST | /v1/byo/peek, /claim | session | Self-run agents |
| POST | /v1/agent/challenge, /session, /setup, /sponsor, /credential | agent | Self-run agents |
| GET | /v1/agent/setup | agent | Self-run agents |
| GET | /v1/private/config | none | Private config and credentials |
| POST | /v1/private/credential | session | Private config and credentials |
| POST | /v1/private/tx/:action | none | Private transactions |
| POST | /v1/admin/kill, /deny, /undeny, /denied | admin token | Admin |
An agent id is a- followed by 16 hex digits. :txId is 32 hex digits.
Route bodies#
The table above is the index. Every request body and every success body is written out on Route reference. The developers' API page links here.