Flow
- An agent discovers a tool through the catalog, OpenAPI, MCP, or docs.
- The agent calls an
/x402/v1/...alias. - Primitive402 returns
HTTP 402 Payment Requiredwith payment requirements. - An x402-capable client pays with USDC and retries to receive structured JSON.
The current public beta network is Base Sepolia. Production or mainnet payment setup may evolve.
The current public beta asset is testnet USDC. Treat beta payments as testnet-only and do not send mainnet funds.
The x402 payment-required payload includes network, asset, amount, payTo, and resource metadata used by compatible clients.
Expected unpaid call
curl -i https://primitive402.dev/x402/v1/extract-subscription-terms \
-H 'content-type: application/json' \
-d '{
"url":"https://stripe.com/legal/subscription-policy"
}'
HTTP 402 Payment Required
Public beta payment verification
Primitive402 has completed end-to-end paid x402 testnet calls on Base Sepolia. The verified sequence was: unpaid request, HTTP 402 Payment Required, Base Sepolia USDC payment, retry, then HTTP 200 with the same structured JSON response shape as the tool's local route.
Internal metrics showed paidX402Calls incrementing after settled paid calls. The current public beta uses Base Sepolia testnet USDC, and the mainnet or payment-provider setup may evolve before production billing.
Verification metadata: network eip155:84532; asset 0x036C...CF7e; seller/payTo 0x1e8c...59ab; buyer 0x6cE9...59db.
Show full values
- USDC asset contract
0x036CbD53842c5426634e7929541eC2318f3dCF7e- Seller/payTo wallet
0x1e8cc376dad053c04e961b203b4f8af73bc759ab- Buyer wallet
0x6cE9a79fa6ebEd47A5c5884f9A3893fe407F59db- check_prompt_injection_risk transaction
0x0480a91f56a010086b9ca0888ccefe9760030817ce730af9fe8a55b09b032abe- extract_subscription_terms transaction
0x1ed7a01f10d65071c2b9babbb56f6bc0f951a2c9131870dc2260ad4e28fb7d96
| Tool | Route | Payment amount | Payment status | Response status | Notes |
|---|---|---|---|---|---|
check_prompt_injection_risk |
/x402/v1/check-prompt-injection-risk |
$0.005 testnet USDC | settlement succeeded | HTTP 200 |
AgentTrust paid tool verified; tx 0x0480a9...32abe |
extract_subscription_terms |
/x402/v1/extract-subscription-terms |
$0.04 testnet USDC | settlement succeeded | HTTP 200 |
Commerce paid tool verified; tx 0x1ed7a0...b7d96 |
Charging policy
HTTP 402 Payment Requiredchallenges are not charged.- Successful paid
2xxtool responses are counted as charged and incrementpaidX402Calls. - Validation errors, unsafe URL blocks, rate limits, server errors, and failed tool executions are not counted as successful paid calls.
- Free-route
429responses incrementrateLimitedCalls, notpaymentRequiredCallsorpaidX402Calls. - Low-confidence
HTTP 200responses may still be charged because they are valid analysis results. - The public beta uses Base Sepolia testnet USDC. Mainnet or payment-provider details may change before production billing.
The x402 middleware verifies payment before Primitive402 route handlers run. Request validation, SSRF protection, tool execution, and final response status happen after that middleware. If a paid beta retry settles but the handler later returns a non-2xx response, Primitive402 does not count it in paidX402Calls; this beta does not attempt automatic refunds.
Troubleshooting
- If a free route succeeds but an x402 route returns 402, inspect the payment-required response and retry with a valid payment header.
- If a wallet or facilitator rejects payment, confirm Base Sepolia, testnet USDC, amount, and recipient metadata.
- If the response is not JSON, verify
content-type: application/jsonand that the request body matches the tool schema.
Discovery
For external marketplace checks, see Discovery readiness.