For agents
An agent cannot open an account or hold a card. It can hold stablecoins. On Snarket it buys what it needs by itself, and what it buys does not point back at whoever runs it.
One wallet in. Everything an agent needs, out.
Give the agent a wallet holding USDG on Robinhood Chain. It needs no gas, no login and no browser. From there it does the rest.
- LookIt reads what is for sale and what each thing costs, as plain data.
- PayIt signs one message to pay for credit. The payment is the only public step.
- ProveIt proves the credit is its own without saying which purchase it was, and gets an API key.
- WorkIt calls models, makes images and searches the web with that key, and tops up when it runs low.
Three ways in.
Pick the one that matches how your agent is built. All three do the same thing.
No code: add it to your agent host
For Claude and any other host that speaks MCP. Add this to its MCP configuration, with the agent's wallet key, and the agent gets eight tools: list what is for sale, check its balance, buy credit, chat, make an image, search, read a page and get an answer.
The two limits are the agent's leash. It cannot spend past them whatever it is told.
{
"mcpServers": {
"snarket": {
"command": "npx",
"args": ["-y", "-p", "{{origin}}/sdk/snarket-sdk.tgz", "snarket-mcp"],
"env": {
"SNARKET_URL": "{{origin}}",
"SNARKET_PRIVATE_KEY": "0x...",
"SNARKET_MAX_BUY_USD": "5",
"SNARKET_BUDGET_USD": "20"
}
}
}
}In your own code: the SDK
A TypeScript library for Node 20 and later. fund() pays and ends with a key; after that every call is one line. Credits and the key are kept in a file readable only by its owner, so a restarted agent still has its balance.
npm install {{origin}}/sdk/snarket-sdk.tgzimport { Snarket } from '@snarket/sdk';
const snarket = new Snarket({
baseUrl: '{{origin}}',
privateKey: process.env.AGENT_PRIVATE_KEY,
});
await snarket.fund(5); // pays 5 USDG, ends with an API key
const reply = await snarket.chat({
model: 'gpt-oss-120b',
messages: [{ role: 'user', content: 'Hello' }],
});
const [picture] = await snarket.image({
model: 'flux-schnell',
prompt: 'A glass cube on still water',
});
console.log(await snarket.balance());
await snarket.close();Any language: the API itself
Everything is an HTTP call, so an agent in any language can do it. Buying is the x402 payment standard. The one step that needs a library is the proof, which is a Groth16 proof over files the API names.
The API reference has every field.
# 1. What is for sale, and what a credit costs
GET {{origin}}/v1/listings
GET {{origin}}/v1/credits
# 2. Buy: answers 402 with payment terms. Sign them
# (EIP-3009, USDG) and send again with the signature.
POST {{origin}}/v1/credits
{"amount_usd": 5, "commitment": "0x..."}
PAYMENT-SIGNATURE: <base64 payment>
# 3. Redeem: the proof and the hash of a key you made
POST {{origin}}/v1/credits/redeem
{"proof": {...}, "root": "0x...", "nullifier_hash": "0x...",
"amount_usd": 5, "key_hash": "..."}
# 4. Work, with the key
POST {{origin}}/v1/chat/completions
Authorization: Bearer snk_...What it can buy.
- Think
models - Open models for reasoning, code and reading images, served in GPU enclaves and charged per token. See the models
- Create
media - Image generation, charged per image and returned as data. See the image items
- Know
search - Web search, page reading and short answers with sources, charged per call. See search and data
- Run
compute - A fresh Linux machine that runs Python, JavaScript or a shell script and returns the output, charged per second. See compute
Keeping an agent on a leash.
Limits you set
- A cap per purchaseThe MCP server refuses any single purchase above
SNARKET_MAX_BUY_USD. The default is 5. - A budget per sessionIt stops buying once it has bought
SNARKET_BUDGET_USDin total. The default is 20. - The wallet itselfThe hard limit is what the wallet holds. Give the agent a wallet with only what you would let it spend.
What to know
- Credit is not refundableOnce bought it stays on Snarket. Buy in small amounts; a credit starts at one dollar.
- The state file is the balanceCredits and the key live in
~/.snarket/state.json. Whoever has that file can spend it, and Snarket cannot restore it. - A failed call costs nothingOnly pictures that were made and calls that returned are charged.
Private by default. More private if it waits.
The key an agent ends up with was never attached to the wallet that paid. What can still link them is timing: an agent that pays and redeems in the same second is easy to pair up.
An agent that cares buys early and redeems later, once others have bought the same amount. The SDK can refuse to redeem below a crowd you choose.
await snarket.buy(5);
// ...later, from wherever it runs...
await snarket.redeem(undefined, { minCrowd: 10 });