Agent API

x402 Protocol Flow

The x402 protocol defines a standard for HTTP-native micro-payments. It transforms the standard 402 Payment Required status code into an automated challenge-and-retry flow.

The Challenge-and-Retry Lifecycle

1

Initial Unpaid Request

The agent makes a standard POST /api/v2/audit request with the target JSON body. No pre-registered API key or subscription token is required.

2

HTTP 402 Challenge with Payment Requirements

Verdict intercepts the unpaid request and responds with 402 Payment Required. The response includes the PAYMENT-REQUIRED header detailing the exact price ($0.50 USDC), network (Base eip155:8453), receiver address, and facilitator parameters.

3

Client Authorization Signing

The agent's x402 client wrapper evaluates the challenge and produces an EIP-712 / EVM payment authorization signature from its local wallet private key.

4

Authorized Request & Verification

The request is retried with the PAYMENT-SIGNATURE header. Verdict verifies the signature and settles payment authorization on Base before commencing computational audit work.

5

Fulfillment & 200 OK

Upon successful audit execution, the server returns 200 OK with the structured JSON audit result and the PAYMENT-RESPONSE receipt header.

Key HTTP Header Specifications

HeaderDirectionDescription
PAYMENT-REQUIREDServer → ClientBase64-encoded JSON or JSON string detailing accepted payment schemes, asset address, amount, and recipient.
PAYMENT-SIGNATUREClient → ServerCryptographic signature matching the advertised EVM scheme proving authorization to transfer $0.50 USDC.
PAYMENT-RESPONSEServer → ClientSettlement receipt metadata confirming transaction verification on Base.