This document lists the public relay and Studio routes, plus the mounted auth and admin route groups currently exposed by @stelis/app-api.
The schema file schemas/relay-api.schema.json covers the relay and promotion request/response shapes that are locked by tests.
| Prefix | Purpose |
|---|---|
/health |
Host health probe |
/relay/* |
Public Relay API flow |
/studio/* |
Developer-JWT promotion flow |
/auth/* |
Admin session authentication |
/api/* |
Operator admin routes |
Returns Host health:
{ "status": "ok", "mode": "generic" }mode is generic or dual.
Returns relay status from @stelis/core-api.
Returns runtime capability:
networkpackageIdsettlementPayoutRecipient: settlement payout recipient address forexecutionCostClaimplusquotedHostFeeMistsupportedSettlementSwapPathsquotedHostFeeMistprotocolFlatFeeMistintegrityPolicyVersion
Clients treat supportedSettlementSwapPaths as the Host's supported settlement token list and settlement swap path list.
Each settlementTokenType appears once and maps to one Host-configured SUI-adjacent DeepBook one-hop settlement swap path. POST /relay/prepare selects that token's active settlement swap path with settlementTokenType; clients do not send a pool ID or path ID.
The settlement swap path includes the DeepBook pool and swapDirection used by the Host. settlementPayoutRecipient is an address, not the Host role or a sponsor signing account.
Prepares a sponsored transaction.
Required fields:
txKindBytes: serialized transaction-kind bytes in base64senderAddress: Sui addresssettlementTokenType: settlement token coin type fromGET /relay/config.supportedSettlementSwapPathstxKindBytesHash: SHA-256 hash oftxKindBytes, encoded as hexprepareAuthorizationTimestampMs: Unix timestamp in milliseconds included in the prepare authorization messageprepareAuthorizationRequestNonce: client-generated nonce included in the prepare authorization messageprepareAuthorizationSignature: Sui personal-message signature over the canonical prepare authorization message
Optional fields:
slippageBpsgasMarginBpsorderId
Minimal JSON body:
{
"txKindBytes": "<base64 TransactionKind bytes>",
"senderAddress": "0x...",
"settlementTokenType": "0x...::coin::COIN",
"txKindBytesHash": "<64 lowercase hex chars>",
"prepareAuthorizationTimestampMs": 1760000000000,
"prepareAuthorizationRequestNonce": "<client nonce>",
"prepareAuthorizationSignature": "<personal-message signature>"
}txKindBytes is a user-supplied User TransactionKind, not the final Host-built transaction. The Host validates it before sponsor slot checkout, nonce reservation, on-chain reads, or transaction building.
The user-supplied User TransactionKind must satisfy these rules:
- It contains zero Stelis settlement calls. The Host appends exactly one settlement call later.
- It contains at most
MAX_COMMANDS = 16commands. - It does not reference
GasCoinin command arguments. - It does not include
PublishorUpgrade. - It does not call unauthorized Stelis package functions.
vault::withdrawis allowed. - It does not include
FundsWithdrawal(Sponsor). - A malformed same-token
FundsWithdrawal(Sender)is rejected withUNACCOUNTABLE_WITHDRAWAL. - A bounded same-token
FundsWithdrawal(Sender)is allowed and is subtracted from address-balance funding.
Funding resolution considers both coin object provenance and FundsWithdrawal(Sender) address-balance accounting. The current funding source outcomes are coin_object, address_balance, and mixed_topup. The current funding failure codes are INSUFFICIENT_BALANCE and PAYMENT_COIN_CONFLICT.
The response includes transaction bytes for user signing and a receiptId for sponsor submission.
The response cost fields include executionCostClaim, which is the gas-recovery claim embedded in the settlement arguments. It is not the full settlement payout; on-chain settlement pays executionCostClaim + quotedHostFeeMist to settlementPayoutRecipient.
The prepare authorization message binds the sender to the transaction-kind hash, selected settlement token type, optional cost fields, optional orderId, timestamp, and request nonce. The Host recomputes txKindBytesHash, verifies the personal-message signature against senderAddress, rejects expired timestamps, and rejects reused prepare authorization nonces before entering the prepare state machine.
prepareAuthorizationRequestNonce is a request replay guard. It is separate from the on-chain settlement nonce returned in the prepare response.
The signed prepare authorization message is a UTF-8 JSON string with these fields in this order:
{
"version": 1,
"network": "testnet",
"packageId": "0x...",
"senderAddress": "0x...",
"txKindBytesHash": "<64 lowercase hex chars>",
"settlementTokenType": "0x...::coin::COIN",
"slippageBps": null,
"gasMarginBps": null,
"orderId": null,
"timestampMs": 1760000000000,
"requestNonce": "<client nonce>"
}packageId and senderAddress are normalized Sui addresses. txKindBytesHash is lower-case hex without a 0x prefix. Omitted optional fields are serialized as null.
Submits a prepared transaction after the user signs it.
Required fields:
txBytesuserSignaturereceiptId
Minimal JSON body:
{
"txBytes": "<base64 transaction bytes returned by prepare>",
"userSignature": "<transaction signature>",
"receiptId": "0x..."
}The route validates the prepared record, checks the transaction again, adds the sponsor signature, and submits.
The submitted txBytes must match the prepared record bound to receiptId. The route verifies the user's transaction signature, checks that tx.sender matches the sender proven at prepare time, consumes the prepared record once, and then re-parses settlement fields from the stored-hash-verified transaction bytes.
The submitted txBytes is the final Host-built transaction. It must contain exactly one allowed settlement call. This final transaction validation is separate from the user-supplied User TransactionKind validation performed during POST /relay/prepare.
The executionCostClaim returned by this route is the transaction-derived gas-recovery claim from the settlement arguments.
Studio promotion routes require:
Authorization: Bearer <developerJwt>
Mounted routes:
GET /studio/promotionsGET /studio/promotions/:idPOST /studio/promotions/:id/claimPOST /studio/promotions/:id/preparePOST /studio/promotions/:id/sponsor
Promotion prepare uses senderAddress and txKindBytes. Promotion sponsor uses receiptId, txBytes, and userSignature.
/auth/* routes create and maintain admin sessions for @stelis/app-admin.
Mounted auth routes:
GET /auth/noncePOST /auth/verifyPOST /auth/renewPOST /auth/logoutGET /auth/session
/api/* routes are operator routes. SDK and MCP clients must not depend on them.
Mounted admin routes:
GET /api/blocklistDELETE /api/blocklistGET /api/logsGET /api/sponsored-logs/summaryGET /api/sponsored-logsGET /api/sponsor-operationsGET /api/sponsor-refill-account/withdrawPOST /api/sponsor-refill-account/withdrawGET /api/settlement-swap-pathsGET /api/studioGET /api/promotionsPOST /api/promotionsGET /api/promotions/:idPUT /api/promotions/:idPOST /api/promotions/:id/statusDELETE /api/promotions/:idGET /api/promotions/:id/usersGET /api/promotions/:id/summary
Agent-facing tools are provided by @stelis/mcp-server, not by a separate /agent/* HTTP route group.
The MCP server calls the relay and promotion routes over HTTP.