Skip to main content
x402 is an HTTP-native payment protocol that lets agents and users sign up and fund Locus workspaces by paying with USDC on Polygon (chain 137) or Base (chain 8453). The protocol uses HTTP 402 status codes to negotiate payments inline — no separate payment step needed.

How it works

1

Agent sends a request

The agent calls the x402 sign-up or top-up endpoint.
2

Server responds with 402 challenge

If payment is required, the server returns HTTP 402 with payment negotiation headers describing what to pay, where, and how much.
3

Agent constructs payment

The agent (or x402 client library) constructs a payment authorization using the payer’s wallet (Polygon or Base) and resends the request with payment headers.
4

Payment settles, request completes

The server validates the payment via the x402 facilitator, settles the USDC transfer, and returns a JWT token and workspace details.
The x402 protocol handles payment negotiation automatically. If you’re using an x402-compatible client library, the challenge-response flow is transparent — the client handles it for you.

Sign up via x402

Creates a new workspace (or returns an existing one) by paying with USDC on Polygon or Base.
The first request returns HTTP 402 with payment details. After the client handles payment negotiation, the successful response is:
Initial credits on sign-up: $6.00

Top up credits via x402

Add credits to an existing workspace using USDC on Polygon or Base.
The server responds with HTTP 402 to negotiate the payment. After settlement:

The x402 protocol flow

The facilitator (facilitator.payai.network) is a trusted intermediary that validates and settles x402 payments on Polygon and Base. When x402 creates a new workspace for an external wallet, a claim link lets the user connect their email and access the Locus dashboard.

Redeem a claim

Git push deploys with x402

x402 users can deploy via git push using their JWT token instead of a claw_ API key:
The git server auto-detects the credential type — claw_ prefix means API key, anything else is treated as a JWT token.

MPP vs x402

Both protocols create the same type of workspace and JWT token. Choose based on which chain your wallet is on. The x402 endpoints accept both Polygon and Base — the client picks which chain to pay on.

Technical details