three.ws Agent Payments

v0.1.5
io.github.nirholas/agentcore-payments-mcp Checked 2 hours ago Published 1 month ago

Governed x402 payment sessions: pay any endpoint with budget, allowlist & per-tx caps, no key.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_payment_session Create a funded agent payment session

Create a platform-managed payment session that funds agent x402 payments from your credits. The agent never needs a private key — it uses the returned session token to call pay_with_session. Governance enforces your budget_usd ceiling, optional per-payment cap (max_per_tx_usd), URL allowlist, and time expiry. Un-spent budget is automatically refunded on cancel or expiry. Returns: session object + token (shown once — store securely). Requires THREE_WS_SESSION.

ParameterTypeDescription
budget_usd *numberTotal budget in USD to allocate to this session (drawn from your credits). Min $0.001, max $1000.
agent_idstringOptional: restrict this session token to a specific agent identity UUID.
allowed_hostsarrayIf set, only allow payments to endpoints at these hosts (e.g. ["api.weather.com"]). Empty = any host.
expiry_secondsintegerSession lifetime in seconds. After expiry, payments are rejected. Default: 3600 (1 hour).
labelstringHuman-readable label for this session (e.g. "Research run #4").
max_per_tx_usdnumberOptional per-payment ceiling in USD. Payments exceeding this are rejected before any money moves.
metadataobjectOptional arbitrary metadata to attach to this session for bookkeeping.
networkstringSettlement network for x402 payments. Solana USDC only.

pay_with_session Pay an x402 endpoint via a payment session

Execute an x402 micropayment against a paid API or MCP endpoint using a Payment Session token. The platform signs the Solana USDC transfer — no private key needed by the agent. Governance enforces budget limits, URL allowlists, and per-tx ceilings before any money moves. Endpoints that respond without a 402 are called for free. Returns the endpoint's response + payment receipt. Uses PAYMENT_SESSION_TOKEN env var if token is not passed inline.

ParameterTypeDescription
url *stringThe x402 endpoint URL to pay and call.
bodyobjectJSON body for POST requests.
idempotency_keystringOptional idempotency key to prevent double-billing on retries.
methodstringHTTP method. Default: GET.
tokenstringPayment session token (starts with "pss_"). Falls back to PAYMENT_SESSION_TOKEN env var.

check_payment_session Check a payment session's budget and status

Inspect a payment session: budget, amount spent, remaining budget, status (active/exhausted/expired/cancelled), expiry time, allowlist, and per-tx ceiling. Optionally include recent payment executions. Requires THREE_WS_SESSION (only the session owner can read it).

ParameterTypeDescription
session_id *stringUUID of the payment session to inspect.
include_executionsbooleanIf true, include the 10 most recent payment executions for this session.

list_payment_sessions List payment sessions and spending stats

List your payment sessions with aggregate spending stats. Filter by status. Stats include: total budget allocated, total spent, active/exhausted/expired counts, settled payment count, and unique endpoints paid. Requires THREE_WS_SESSION.

ParameterTypeDescription
limitintegerNumber of sessions to return (max 100).
statusstringFilter by session status. Omit to return all sessions.

cancel_payment_session Cancel a payment session and refund unused budget

Cancel an active payment session. The un-spent portion of the budget is immediately refunded to your credit balance. Already-completed payments are not reversed. Idempotent — safe to call on an already-cancelled session. Requires THREE_WS_SESSION.

ParameterTypeDescription
session_id *stringUUID of the session to cancel.