SubGuardian

Developer Demo / API Simulator

AI Agent spends only after SubGuardian checks budget, usage, and policy, then returns allow / pause / reject / ask_user with auditable proof.

Simulated Agent Spend Request

Ask before spending

POST /api/v1/spend/authorize
Advanced defaults

category

API

currency

USDT

billingCycle

monthly

Default values are ready to test.

How it works

1
Agent asks before spending
2
SubGuardian checks policy + budget + usage
3
API returns allow / pause / reject / ask_user with proof

API Integration

Minimum fetch example

POST
const res = await fetch("/api/v1/spend/authorize", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer sg_demo_local",
    "X-SubGuardian-Demo": "developers-page"
  },
  body: JSON.stringify({
    agentId: "research-agent",
    userWallet: "0x...",
    serviceName: "OpenAI API",
    amount: 18,
    reason: "Run customer research task"
  })
});

const decision = await res.json();