# x402-agent-pay Energy Buy Order

> x402-agent-pay Energy Buy Order is a paid API for AI agents from x402-agent-pay.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Buys agent energy (kWh) up to a specified max price by matching the cheapest resting sellers and settling USDC to seller wallets on Base L2

## Facts

- Endpoint: POST https://x402-agent-pay.com/labs/api/energy/buy
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-agent-pay-energy-buy-order-75d2a4a8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6TGSdxSOMsc8I0M2mZRR3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-agent-pay-energy-buy-order-75d2a4a8 -d '<json body>'
```

Example prompt: Buy energy for my agent — I want up to 10 kWh and I'm willing to pay no more than 0.05 USDC per kWh; match whatever the cheapest resting sellers have and settle on Base.

## When to prefer this

Choose this endpoint when an AI agent or IoT device needs to autonomously purchase energy (kWh) on a decentralized marketplace with best-price matching against resting sell orders and on-chain USDC settlement on Base L2. Ideal for agents that require energy credits programmatically without manual intervention, particularly in microgrid or machine-to-machine commerce scenarios where cost-capped limit buying is important.

## Known failure modes

- No resting sellers available at or below the specified max price — order not filled
- Insufficient USDC balance to cover the purchase plus $0.02 call fee
- x402 payment authentication failure — agent wallet not authorized
- Base L2 network congestion causing settlement delays or failures
- Invalid kWh quantity or max price parameters in request body
- Settlement transaction hash unavailable if on-chain confirmation is pending

## How this service works

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

## Output

Returns a success boolean, a response data payload confirming the energy purchase, and an on-chain settlement transaction hash on Base L2 showing the USDC payment to the matched seller's wallet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "description": "Response payload"
  },
  "success": {
   "type": "boolean"
  },
  "settlement_tx": {
   "type": "string",
   "description": "On-chain settlement transaction hash"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-agent-pay-energy-buy-order-75d2a4a8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-agent-pay.com](https://www.zero.xyz/host/x402-agent-pay.com/llms.txt)
