Ask the agentConsoleDocsTractionArcscan
Open app
Getting started
  • Quickstart
Concepts
  • The Meter & Units
  • Streaming & Proof-of-Flow
  • Citation Toll & Royalty Splits
  • Reputation Bonds
Build
  • sluice-pay SDK
  • MCP server
  • API reference
  • Connectors
  • List your endpoint on the Bazaar
Compatibility
  • RSL & llms.txt
  • Self-hosting the toll sidecar
Trust
  • Changelog
  • FAQ
Resources
Whitepaper (PDF) ↗
Build

sluice-pay SDK

@sluice/paywraps Circle's GatewayClient and the Sluice registry, with budget + reasoning guards and deposit-aware balance checks.

Install

bash
pnpm add @sluice/pay

Pay

ts
const sluice = new SluicePay({ privateKey });
const { data, amount } = await sluice.pay(resourceId, { maxAmount: 0.01 });

Budget & reasoning

ts
const sluice = new SluicePay({ privateKey, budget: 0.50 }); // cumulative cap

await sluice.pay(id, {
  maxAmount: 0.01,
  onDecision: ({ formattedPrice }) => confirm(`pay ${formattedPrice}?`), // abort by returning false
});

Deposit-aware

pay() checks your Gateway balance first and fails with an actionable error instead of a revert. Use autoDeposit: true or deposit explicitly with sluice.deposit("1.00").

PreviousReputation Bonds
Next MCP server
On this page
  • Install
  • Pay
  • Budget & reasoning
  • Deposit-aware