← Deep First Search

OneSource + Agent Safe: blockchain data for agents, capped

OneSource serves blockchain data to agents over x402, paid per call in USDC on Base. Agent Safe adds the guardrail people need before leaving an agent running: payments go only to OneSource's address, never above your per-call cap, never past the budget, whatever the agent was told.

Tested live on Base mainnet (2026-10-07): an agent paid OneSource 0.001 USDC for GET /api/chain/block-number?network=ethereum and got the latest Ethereum block number. Transaction. The same 402 checked against a different payee was refused with zero signatures.

1. Add OneSource as a merchant

import { createAgentPay, MerchantRegistry } from "@deepfirstsearch/agent-pay";

const registry = new MerchantRegistry([{
  origin: "https://api.onesource.io",
  payTo: "0x52E29e0d2Aa49bfBfC548C0A9F2196F4aa51f3ea", // OneSource's Base address, as in its 402
  network: "eip155:8453",
  maxPerTx: 2_000n, // never more than 0.002 USDC per call
  pricePin: 1_000n, // 0.001 USDC, the published price
  maxTimeoutSeconds: 3600, // OneSource asks for 60-minute authorizations; this widens the window for this merchant only
  label: "OneSource",
}]);

2. Pay per call

const pay = createAgentPay({
  registry,
  policy: { allowedNetworks: ["eip155:8453"], periodBudget: { amount: 1_000_000n, periodMs: 86_400_000 } },
  payer: () => yourWallet, // any viem account: local key, Turnkey, Privy, CDP, KMS
  session: { readsUntrustedInput: true, accessesSensitiveData: false, canPay: true },
});
const plan = pay.commitPlan([{ origin: "https://api.onesource.io", maxSpend: 100_000n }], 60 * 60_000);

const res = await pay.fetch("https://api.onesource.io/api/chain/block-number?network=ethereum", { method: "GET" }, { plan });
console.log(res.status, res.payment?.settlement.transaction);

A 402 that asks for a different payee, a higher price or a different network is refused before anything is signed. Requires @deepfirstsearch/agent-pay 0.5.5 or later (per-merchant maxTimeoutSeconds).

Source, issues and the full SDK: github.com/DeepFirstHQ/deepfirstsearch. Questions or a merchant you'd like covered: Discussions.

Agent Safe is an independent open-source project (MIT), live on Base mainnet as an unaudited beta. Not affiliated with OneSource.