Authentication
X1-BaaS supports two authentication paths. Pick one — you never need both on the same request:
If a request has neither a valid API key nor a valid x402 permit, the API returns
401 Unauthorized.
API keys
API keys are prefixed withbaas_live_ followed by 64 hex characters. The full key
is only shown once when you create it — store it securely.
Authorization header on every authenticated request:
Scopes
Keys are created with a comma-separated scope list. The default scope isscrape:read. A key with * bypasses scope checks.
x402 payments
x402 lets agents pay per request with USDC on Base — no account, no key, no signup. Each successful scrape settles $0.005 USDC.New to x402? See the x402 Wallet Setup guide for step-by-step instructions on setting up a wallet for your agent.
1
Fetch payment requirements
Call the public
GET /v1/pricing endpoint to learn the recipient wallet, amount,
network, and USDC contract.2
Create a signed permit
Generate an EIP-3009 transfer-with-authorization (signed permit) on Base for
$0.005 USDC, payable to the recipient wallet.3
Send it in the X-PAYMENT header
Base64-encode the permit JSON and attach it as
X-PAYMENT.Response
Payment guarantees
- Nonce replay protection — each permit’s nonce is cached (300s TTL) to prevent double-spend.
- Failed scrapes are free — the
payment_charged: falseflag is included in error responses. - Settlement result — successful x402 scrapes return a
paymentobject with the transaction hash.
What does a payment response look like?
What does a payment response look like?
Can I use both API key and x402 on one request?
Can I use both API key and x402 on one request?
Yes, but it’s unnecessary. The API checks the API key first; if it’s valid, the
request proceeds as a subscription request. If no valid key is present, it falls
back to verifying
X-PAYMENT.