arrow_back All projects
Case study · Web3 · Sui

SEAL

Non-custodial AI billing on Sui — one API key, multi-provider routing, hard spend caps enforced by Move.

Role Web3 / fullstack engineer
Stack Move · TS · Next.js

Overview

SEAL (v0.2) is a decentralized Sui-native protocol for AI teams: deposit SUI once, configure on-chain spend limits, and let agents call LLMs through a single key while settlement and caps live on Move contracts. Tagline from the repo: “One API key. Multiple providers. On-chain caps.”

The problem

AI agent spend is usually a developer credit card behind a shared API key. There is no hard ceiling if an agent loops, gets prompt-injected, or fans out sub-calls. Teams need multi-provider routing without trusting a custodian with the full treasury.

The approach

Split trust: users sign deposit, caps, and pause via PTBs; the gateway only signs authorize_call for settlement. Daily, monthly, and per-provider limits are enforced on-chain so a compromised key cannot override policy.

Architecture

Three-layer system

01

Gateway (Node/TS)

API key auth, provider routing (Groq/OpenAI/Anthropic/x402), velocity tracking, soft pause, rate limiting, and batch settlement (~5 min configurable).

02

Sui Move contracts

Deposit/withdraw, set_spend_caps / set_provider_cap, authorize_call (gateway-only), pause/unpause (user-only). Events: Deposit, Withdraw, Receipt, Pause, Alert.

03

Next.js dashboard

Wallet connect via Mysten dapp-kit, treasury setup PTB, API key management, anomaly banners, spend history, provider status, and live status polling.

Key capabilities

  • · Non-custodial by design — no trust assumption on gateway operator for treasury ops
  • · Programmable spend caps cannot be overridden by a compromised API key
  • · Velocity-based anomaly detection with auto-pause and manual resume
  • · SealClient SDK for chat completions with cost in MIST
  • · Event indexer with per-type cursors for dashboard truth

Gateway surface (sample)

  • POST /v1/chat — primary completion flow
  • POST /api/:provider — x402-protected route
  • GET /status/:wallet — balance, caps, pause, velocity
  • POST /keys/create · /settle · /resume

Engineering takeaways

Next case study

Otter

Hierarchical agent treasuries on Sui

arrow_forward