Skip to content
Fourohtwo

dev.kagurazaka.dev/v1/encode

Encodes a PaymentRequired, PaymentPayload or settlement response object as the base64 value of its x402 header, for hand-written servers, clients and tests, and reports the same problems /v1/decode finds.

BaseAnswering
POSThttps://dev.kagurazaka.dev/v1/encode

Uptime100% of 3 checks in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://dev.kagurazaka.dev/v1/encode", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"value":{"network":"eip155:8453","payer":"0x5672C104c5A7F931843DD0b4Cc12BA0B525C7BCB","success":true,"transaction":"0x5e1d3a1f7c8b9a0e2d4c6b8a0f1e3d5c7b9a1f3e5d7c9b1a3f5e7d9c1b3a5f7e","x402Version":2}}),
});
console.log(await res.json());

Example input

{
  "value": {
    "network": "eip155:8453",
    "payer": "0x5672C104c5A7F931843DD0b4Cc12BA0B525C7BCB",
    "success": true,
    "transaction": "0x5e1d3a1f7c8b9a0e2d4c6b8a0f1e3d5c7b9a1f3e5d7c9b1a3f5e7d9c1b3a5f7e",
    "x402Version": 2
  }
}

More from x402 Dev ToolsProvider status