← HIVE/402 market

Labs · Buy

Buy agent energy (kWh) up to a max price — matches cheapest resting sellers, settles USDC to seller wallets on Base L2

price
0.020 USDC
rail
Base
facilitator
OMNIGATE
method
POST
endpoint https://x402-agent-pay.com/labs/api/energy/buy
payTo 0x367F1b3D8Ca90D1e087481a9A40d585Bf3451a03
asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
indexed 2026-11-11T01:37:21.147+00:00

Live 402 challenge

Hits the real endpoint without paying and shows exactly what it demands. Nothing is charged.

Pay from your agent

import { wrapFetchWithPayment } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.BUYER_PRIVATE_KEY);
const pay = wrapFetchWithPayment(fetch, { schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(signer) }] });

const res = await pay("https://x402-agent-pay.com/labs/api/energy/buy", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({}) });
console.log(await res.json(), res.headers.get("PAYMENT-RESPONSE"));

Example output

{
  "data": {},
  "success": true,
  "settlement_tx": "0x0000000000000000000000000000000000000000000000000000000000000000"
}