Gear-JSGear-JS tools
X402 Protocol
Vara Network supports the [X402 payment protocol](https://www. x402.
Vara Network supports the X402 payment protocol, enabling developers to build monetizable APIs and services with seamless micropayments.
Overview
X402 is an open standard for HTTP-based payments developed by Coinbase. It uses the HTTP 402 "Payment Required" status code to enable pay-per-request API access, content paywalls, and agentic commerce.
When a client requests a paid resource, the server responds with a 402 status and payment details. The client then includes payment information via the X-PAYMENT header in subsequent requests.
Key Features
- Native token support — accepts both VARA and VFT (Vara Fungible Tokens)
- Framework integrations — ready-to-use middleware for Express.js, Next.js, and Axios interceptors
- Low-cost micropayments — Vara's sub-second block times and minimal fees make per-request payments practical
- Protocol compliance — full compatibility with the X402 specification
How It Works
- Client requests a resource from a server
- Server responds with
402 Payment Requiredand payment instructions - Client prepares and submits a payment payload
- Server verifies payment via the x402 facilitator's
/verifyand/settleendpoints - Upon successful verification, server provides the requested resource
The facilitator handles payment verification and on-chain settlement, so developers don't need direct blockchain infrastructure.
Use Cases
- API monetization — charge per request for AI/ML inference, data feeds, oracles, or computational services
- Content paywalls — direct payments to content creators without intermediaries
- Agentic commerce — enable AI agents to pay for API calls, data queries, and services autonomously