Skip to main content
x402 is the agentic-native entrypoint — an autonomous agent with a wallet can use Contra without ever registering, paying USDC per call. The wallet that pays is the tenant.

The handshake

POST /v1/sessions
→ HTTP 402 Payment Required
{
  "asset":   "USDC",
  "network": "base",
  "maxAmount": "100000",        // 0.10 USDC
  "payTo":   "0xContraMerchant",
  "nonce":   "0x…",
  "resource": "create_verification"
}

# Agent's wallet signs an EIP-3009 transferWithAuthorization
# Retries with X-Payment header

POST /v1/sessions     (with X-Payment)
200 OK · ContraToken

How billing aligns with cost

  • Hold at start (no charge yet) → Smile may incur cost.
  • Settle at decision (charge only if a verdict was produced) → fair to both sides.
  • Status reads are free (GET /v1/sessions/:id).
  • Compliance lookups are free (GET /v1/compliance/:address — on-chain read mirror).

When to use x402

  • You’re building for an autonomous agent, not a human dev.
  • You want no signup, no key, just a wallet.
  • You’re calling per-transaction and want strict cost↔value alignment.
If instead you’re a company onboarding many users, use the multi-tenant SDK with a normal x-api-key.