GET /api/memory · USDC via x402Read from your wallet-scoped memory. ?key=… returns the stored value; omit key to list your keys. Only the wallet that paid for the writes can read them.
| Field | Type | Description |
|---|---|---|
key | string | Key to read; omit to list all your keys |
{
"key": "research/task-42",
"value": {
"status": "done"
},
"updated": 1760000000000
}
curl -i "https://agent402.tools/api/memory?key=research%2Ftask-42"
The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/memory?key=research%2Ftask-42");
POST /api/memoryPersistent key-value memory for agents, scoped to the paying wallet. Your x402 payment IS your authentication:…