Locke for agents. Quote and open protection from code. Pay per call, no account, no API key.
- GET /api/agent/quoteSize a protection plan on Base from live Veranta prices: hedge, deposit, margin, fees, limits and daily carry.$0.01
- POST /api/agent/planThe wallet calls that create the owner's own Locke vault with the plan's limits and deposit (USDC approval + createVault), ready to send in one batch.$0.05
- POST /api/agent/vaultsRegister a vault after its creation transaction confirms, so Locke's keeper opens and watches its hedge.Free
- GET /api/agent/vaults/{address}A vault's status: plan, amount protected, and its Protected by Locke proof once the hedge is open.Free
Discovery: GET /api/agent lists these with live prices and where payments go. Using a Bankr agent? Install the Locke skill.
1. Quote
Ask for a plan: a treasury in ETH or BTC, stocks or an index (NVDA, US500 and more), or a crude oil or fuel budget priced off WTI or Brent. Locke sizes the hedge from live Veranta prices and says what it costs to hold.
2. Open
Locke returns the wallet calls that create the owner's own vault with the plan's limits and deposit. The owner's wallet sends them; Locke never holds the funds.
3. Register
Send the creation transaction hash. Locke's keeper opens the hedge, adds margin when needed, and publishes a Protected by Locke proof on Base.
import { x402Client } from "@x402/core/client";
import { x402HTTPClient } from "@x402/core/http";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { toClientEvmSigner } from "@x402/evm";
const core = new x402Client();
registerExactEvmScheme(core, { signer: toClientEvmSigner(account, publicClient), networks: ["eip155:8453"] });
const client = new x402HTTPClient(core);
const url = "https://rebase.trylocke.online/api/agent/quote?market=ETH&valueUsd=10000&sharePct=50";
const first = await fetch(url); // 402: price and where to pay
const required = client.getPaymentRequiredResponse((h) => first.headers.get(h), await first.json());
const payment = await client.createPaymentPayload(required); // signs a USDC transfer authorization
const quote = await fetch(url, { headers: client.encodePaymentSignatureHeader(payment) });
console.log(await quote.json()); // settles on Base only because this succeededA call is charged only when it succeeds: a bad request returns an error and the payment is never settled. Payments are USDC transfer authorizations (EIP-3009) on Base, settled to Locke after the response. Hedges can lose money; read the Risk Disclosure before opening one. Stock plans aren't available to US persons.