No wallet needed · No real USDC spent · Immediate

x402 Sandbox

Test your x402 payment signing implementation without spending a single cent. Get a free key, call fake services, and validate your payload format before going live.

How it works

1

Get a free sandbox key (no signup)

2

Call sandbox services — they return real 402 responses

3

Implement EIP-3009 signing and retry with payment-signature

4

Sandbox validates format, returns data with any warnings

5

Swap sandbox URL for real — one field change to go live

1

Get a free sandbox key

Click the button or run the curl command. No account needed.

curl https://api.ideafactorylab.org/sandbox/key
2

Call a sandbox service — get the 402

Call without any payment headers first. You'll get a 402 with the payment requirements.

curl https://api.ideafactorylab.org/sandbox/weather?location=Tokyo # Returns 402 + payment-required header with base64-encoded payment details
3

Implement signing and retry

Decode the payment-required header, sign with EIP-3009, and retry. The sandbox checks your payload format.

// 1. Decode the payment-required header const payReqs = JSON.parse(Buffer.from(header, 'base64').toString()); const req0 = payReqs.accepts[0]; // 2. Sign with EIP-3009 using @x402/evm const raw = await scheme.createPaymentPayload(payReqs.x402Version, req0, null); // 3. CRITICAL: add the accepted field (PayAI requires this) const payload = { ...raw, accepted: req0 }; // 4. Encode and retry const encoded = Buffer.from(JSON.stringify(payload, (k,v) => typeof v === 'bigint' ? v.toString() : v)).toString('base64'); const result = await fetch(url, { headers: { 'payment-signature': encoded, 'x-cw-sandbox': YOUR_KEY } });
The most common mistake: missing the accepted field. The PayAI facilitator silently rejects payloads without it. Full debug guide: here.
4

Test with your sandbox key

Paste your sandbox key and try calling the weather endpoint with it:

Validate a payment payload

Have a payment payload? Paste it here and we'll check the format without calling a service.

Ready to go live?

Once your implementation works in sandbox, switching to production is one change: use the real proxy instead of the sandbox URL. We handle all the signing for you.

Set Up Real Proxy Debug Real Service