The verbs
resolve, pay, verify and disclose. Everything else on the API only reads.
The write surface is these and nothing else, which is deliberate. A surface an agent can hold in its head is a surface it uses correctly, and a small surface is one we can actually make safe.
resolve
Turn any reference to a counterparty into one identity: what it is, how it accepts money, and what is known about it. You will usually call this first, because everything downstream depends on knowing who is on the other side.
const seller = await gl.resolve("compute.example");
// seller.accepts -> the ways this counterparty can be paidpay
Submit a signed instruction to move value. We decide first. On yes it settles on whichever way that seller accepts and you get a receipt. You never hold the thing that moves the money, which is what makes the decision meaningful rather than advisory.
const receipt = await gl.pay({
payee: "compute.example",
amount: { value: "420000", asset: "USDC" },
purpose: "inference, batch 41",
});verify
Check somebody else's signed claim about themselves against your policy. This is the inbound direction: an agent shows up saying what it is, and you decide whether that is good enough to deal with.
const decision = await gl.verify(theirDisclosure);
if (decision.outcome !== "allow") return; // allow | confirm | denydisclose
The outbound direction. Produce your own signed claim: what this agent is, and what it is authorised to do. Hand it to a counterparty that asks.
const mine = await gl.disclose();And the read side
Reading never decides anything, and never moves anything.
memoryRemember,memoryRecall,memoryAssembleandmemoryVerify, where a deployment runs the memory store.auditfor the record, as a page or as a live stream.intents/{id}for a single payment, and its events for everything that happened to it.usagefor what has been spent, over a period or by customer.