x402 is available on paid Pinata accounts. Upgrade your account to access x402 monetization features.
Overview
Pinata’s x402 implementation enables:- Monetization of private IPFS content using Payment Instructions
- You receive payments directly to your wallet address. Payments go to you.
- Flexible payment requirements configurable per file or group of files
- USDC payments on Base (mainnet) and Base Sepolia (testnet). USDC is currently the only supported token.
- Gateway-level enforcement through the x402 protocol
Network Configuration
| Network | USDC Token Address | Use Case |
|---|---|---|
| Base (Mainnet) | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | Production monetization |
| Base Sepolia (Testnet) | 0x036CbD53842c5426634e7929541eC2318f3dCF7e | Testing payment flows |
How It Works
- Upload a private file to Pinata IPFS
- Create a Payment Instruction with your desired payment requirements
- Attach the CID of your private file to the Payment Instruction
- Share your x402 gateway URL:
https://your-gateway.mypinata.cloud/x402/cid/{cid} - Requesters make USDC payments through your gateway to access content
You must use your own dedicated Pinata gateway domain. Replace
your-gateway.mypinata.cloud with your actual gateway domain throughout these examples.Example Workflow
Why Use Payment Instructions
Payment Instructions enable you to monetize your private content by setting custom payment requirements and receiving payments directly to your wallet. Key benefits:- You get paid for your content. Set your own prices and receive USDC payments directly.
- Flexible pricing for different files or groups of files
- Reusable payment instructions that can be attached to multiple CIDs
- Full control over payment requirements, pricing, and access
SDK Reference
x402 Overview
Get started with x402 monetization
Payment Instructions
Create and manage payment instructions
CID Management
Attach CIDs to payment instructions
Types
TypeScript type definitions