How Obol works
An owner gives an AI agent a purse: a private balance on its own key, with rules. When an API answers 402 Payment Required, the agent checks the price against the rules, pays with a confidential transfer on Helius Privacy Rings, and retries. The API decrypts the payment, serves once and signs a receipt.
Pay with a fetch
Create a purse in the console and export its key. The key carries the spend key and the rules, so keep it secret. The playground runs exactly this flow in your browser.
OBOL_AGENT_KEY=obk_eyJ2IjoxLCJuZXR3b3JrIjoibWFpbm5ldCIs… # from the console
// 1. call the API
let res = await fetch(url)
// 2. on 402, read the quote and check your rules
if (res.status === 402) {
const quote = await res.json() // { price, asset, payTo, provider, path }
assertRules(quote) // payee list, cap per payment, cap per day, expiry
// 3. pay privately: a confidential transfer to quote.payTo.shielded
const { signature, slot } = await sendPrivate(agentKey, quote.payTo.shielded, quote.price)
// 4. retry with a proof signed by the agent key
res = await fetch(url, { headers: { 'x-obol-payment': signProof({ signature, slot, path, ts }) } })
}
const receipt = res.headers.get('x-obol-receipt')Charge with a gate
A gate sits in front of a paid route. Unpaid requests get a quote. Paid requests are verified by decrypting the payment with your payee key. Earnings land in your private balance, and the directory shows how many calls you have settled, never how much you earned.
GET /api/x/atlas → 402
{ "obol": 1, "network": "mainnet", "provider": "atlas", "name": "Atlas Price",
"asset": "USD", "price": "10000", "path": "/api/x/atlas",
"payTo": { "solana": "4qEj…sntL", "shielded": "ATju…OSxg" } }
GET /api/x/atlas x-obol-payment: <proof> → 200 + x-obol-receipt: <receipt>Live gated endpoints you can call today: /api/x/atlas, /api/x/pulse, /api/x/muse, /api/x/abyss. Self-hosted gates are on the roadmap; the protocol below is everything a gate needs.
Headers and messages
Quote (402 body): price in base units, asset, the payee’s Solana address and private (shielded) address, the provider id and path.
x-obol-payment: base64 JSON { v, signature, slot, agent, path, ts, sig }. sig is an ed25519 signature by the agent key over obol-pay:v1:signature:slot:agent:path:ts. Proofs older than 10 minutes are refused.
x-obol-receipt: base64 JSON { provider, payee, agent, signature, slot, asset, amount, requestHash, at, sig }, signed by the payee key. Anyone can check it on the verify page; the amount is the payee’s attestation, since the chain only holds it encrypted.
Status codes: 402 quote or underpaid · 401 proof not signed by the paying key · 409 payment not confirmed or indexed yet (retry) · 410 payment already used.
What is enforced where
Rules marked Agent runtime are enforced by the Obol code the agent runs, not by an on-chain program. If someone steals an agent key, they can spend that purse but nothing else of the owner’s, and the owner can revoke it. On-chain rule enforcement needs a dedicated program and is on the roadmap.
Helius Privacy Rings
Every Obol payment is a confidential transfer in the Default Ring of Helius Privacy Rings, the Solana privacy protocol from Helius. Proofs come from the Helius attested prover, and encrypted notes are synced from the Helius indexer. Obol is an independent app built on top. It is not operated or endorsed by Helius.
What to know
- In the Default Ring the agent and API addresses are public. Amounts, assets and balances are not.
- Funding a purse costs the agent a little public SOL for its own transaction fees.
- Payments are made before the API serves. If an API takes a payment and doesn’t serve, the receipt is missing and its standing shows it.
- Obol is a mainnet beta, capped at 200 USDC per action. The SDK is alpha and nothing here is audited, so keep purses small.