Pay for verified data with USDC on Base. No API key. No signup.
This is a minimal example showing how to call Strale data capabilities via the x402 protocol — HTTP-native payments for AI agents.
x402 adds a payment layer to HTTP. Your agent makes a request, gets a 402 response with payment details, pays with USDC on Base, and receives the data. Two HTTP calls, no accounts.
1. GET /x402/iban-validate?iban=DE89370400440532013000
→ 402 Payment Required (price, wallet, payment instructions)
2. Pay USDC on Base using the payment details
3. GET /x402/iban-validate?iban=DE89370400440532013000
+ X-PAYMENT header with payment proof
→ 200 OK (structured JSON result)
- Node.js 18+
- A Base wallet with USDC (for paid capabilities)
git clone https://github.com/strale-io/strale-x402-starter.git
cd strale-x402-starter
npm install
npx tsx index.ts- Discovers available x402 endpoints via
/.well-known/x402.json - Requests a capability and receives the 402 payment details
- Shows the payment flow structure
The free-tier capabilities (iban-validate, email-validate, dns-lookup, json-repair, url-to-markdown) return data directly without payment — useful for testing the flow.
Browse all available x402 endpoints:
curl https://api.strale.io/.well-known/x402.jsonMIT