# x402 Dev Tools – Build PaymentRequired Object

> x402 Dev Tools – Build PaymentRequired Object is a paid API for AI agents from dev.kagurazaka.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-30).

Generates a fully-formed x402 v2 PaymentRequired object and base64 PAYMENT-REQUIRED header value for a given USD price across one or more networks, with correct USDC contract addresses, atomic amounts, and EIP-712 domain info.

## Facts

- Endpoint: POST https://dev.kagurazaka.dev/v1/requirements?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-dev-tools-build-paymentrequired-object-7cae3ba9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IYpnDWPXmkraHSAwysw-O

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-dev-tools-build-paymentrequired-object-7cae3ba9 -d '<json body>'
```

Example prompt: Build me an x402 v2 PaymentRequired object for my API at https://api.myservice.com/v1/data — I want to charge $0.05 USD, send payments to 0xe6f7508ab572a4dc9c7486ea017b100d83f3c3f8, and support both Base (eip155:8453) and Arbitrum (eip155:42161). Give me the base64 header value and the full payment_required object.

## When to prefer this

Use this endpoint when you are building or testing an x402 v2 compliant API seller and need to programmatically generate correct PaymentRequired objects without manually computing atomic USDC amounts, looking up USDC contract addresses per network, or constructing EIP-712 domain strings. It is especially useful for multi-network setups where each network has different contract addresses and token decimals. Prefer this over manual construction or generic x402 libraries when you want a single call to produce a ready-to-use base64 header value.

## Known failure modes

- Invalid or unsupported CAIP-2 network ID returns an error listing known networks
- Missing required fields (pay_to, price_usd, resource) result in a 400 validation error
- price_usd with more than 6 decimal places may be rejected or rounded
- Non-HTTPS resource URL may be rejected as x402 requires HTTPS resources
- Malformed Ethereum address in pay_to causes a validation failure

## How this service works

Builds an x402 v2 PaymentRequired object for a price in dollars on one or more networks, with the right USDC contract, atomic amount and EIP-712 domain (name and version) for each, plus the base64 PAYMENT-REQUIRED header value to send with the 402.

## Output

Returns a JSON object containing: (1) a base64-encoded `header` string ready to send as the PAYMENT-REQUIRED HTTP header, and (2) a fully structured `payment_required` object including the x402Version, resource URL and MIME type, and an `accepts` array where each entry has the correct USDC asset contract address, EIP-712 domain (name and version), payTo address, atomic USDC amount derived from the USD price, network CAIP-2 ID, scheme, and maxTimeoutSeconds — one entry per requested network.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "pay_to": {
   "type": "string",
   "description": "the address that receives the payment"
  },
  "networks": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "CAIP-2 ids or v1 names (default eip155:8453); known: eip155:8453, eip155:84532, eip155:1, eip155:137, eip155:42161, eip155:10, eip155:43114"
  },
  "resource": {
   "type": "string",
   "description": "the https URL being sold"
  },
  "mime_type": {
   "type": "string",
   "description": "default application/json"
  },
  "price_usd": {
   "type": "number",
   "description": "price in dollars, up to 6 decimals"
  },
  "description": {
   "type": "string"
  },
  "max_timeout_seconds": {
   "type": "integer",
   "description": "default 300"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "header": "eyJ4NDAyVmVyc2lvbiI6Mi...",
  "payment_required": {
   "error": "Payment required",
   "accepts": [
    {
     "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
     "extra": {
      "name": "USD Coin",
      "version": "2"
     },
     "payTo": "0xe6f7508ab572a4dc9c7486ea017b100d83f3c3f8",
     "amount": "1000",
     "scheme": "exact",
     "network": "eip155:8453",
     "maxTimeoutSeconds": 300
    }
   ],
   "resource": {
    "url": "https://api.example.com/v1/weather",
    "mimeType": "application/json",
    "description": ""
   },
   "x402Version": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-dev-tools-build-paymentrequired-object-7cae3ba9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from dev.kagurazaka.dev](https://www.zero.xyz/host/dev.kagurazaka.dev/llms.txt)
