Skip to main content

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 with baas_live_ followed by 64 hex characters. The full key is only shown once when you create it — store it securely.
Send the key in the Authorization header on every authenticated request:
Never commit API keys to source control or expose them in client-side code. Use environment variables or a secret manager.

Scopes

Keys are created with a comma-separated scope list. The default scope is scrape: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.
The flow has three steps:
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

You’re only charged on success. Payment is verified before the scrape and settled only after a successful result. Timeouts and connection failures return payment_charged: false and never settle.
  • Nonce replay protection — each permit’s nonce is cached (300s TTL) to prevent double-spend.
  • Failed scrapes are free — the payment_charged: false flag is included in error responses.
  • Settlement result — successful x402 scrapes return a payment object with the transaction hash.
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.

Public endpoints (no auth)

These endpoints require no authentication: