three.ws Agent Payments
v0.1.5Governed 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.
| Parameter | Type | Description |
|---|---|---|
budget_usd * | number | Total budget in USD to allocate to this session (drawn from your credits). Min $0.001, max $1000. |
agent_id | string | Optional: restrict this session token to a specific agent identity UUID. |
allowed_hosts | array | If set, only allow payments to endpoints at these hosts (e.g. ["api.weather.com"]). Empty = any host. |
expiry_seconds | integer | Session lifetime in seconds. After expiry, payments are rejected. Default: 3600 (1 hour). |
label | string | Human-readable label for this session (e.g. "Research run #4"). |
max_per_tx_usd | number | Optional per-payment ceiling in USD. Payments exceeding this are rejected before any money moves. |
metadata | object | Optional arbitrary metadata to attach to this session for bookkeeping. |
network | string | Settlement 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.
| Parameter | Type | Description |
|---|---|---|
url * | string | The x402 endpoint URL to pay and call. |
body | object | JSON body for POST requests. |
idempotency_key | string | Optional idempotency key to prevent double-billing on retries. |
method | string | HTTP method. Default: GET. |
token | string | Payment 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).
| Parameter | Type | Description |
|---|---|---|
session_id * | string | UUID of the payment session to inspect. |
include_executions | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of sessions to return (max 100). |
status | string | Filter 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.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | UUID of the session to cancel. |