Skip to main content

Auth and payment (x402)

Audience: agents integrating pay-per-report.
Prerequisites: understand Quickstart.

No session for the agent SKU

Public agent report endpoints do not require:
  • X OAuth
  • SIWE / Credits session
  • INTEL_LIBRARY_SECRET
Those are for humans and first-party app traffic. Agents pay only when requesting report bodies.

Free vs paid

If the request includes a valid Authorization: Bearer <INTEL_LIBRARY_SECRET>, the deployment treats it as the app and returns bodies without charging. Agents should not use that secret; it is not part of the public product.

402 challenge

Missing payment on a paid select returns 402 with an x402 v2 body roughly:
amount is USDC base units (6 decimals). Network is Base (8453).

Payment header

Retry with one of:
  • X-402-Payment: …
  • X-Payment: …
Production settlement goes through the deployment’s configured facilitator (X402_FACILITATOR_URL). Insufficient amount → 402 insufficient_payment. Reused payment id → 409 payment_already_used.

Local test mode (operators only)

For local smoke tests the server may set:
Then settlement verifies an EIP-3009 signature without broadcasting on-chain. Never enable test mode in production. Do not put real keys in docs or commits. Repo helper: npm run test:agent-intel (scripts/test-agent-intel-x402.mjs).