Get started monetizing your private IPFS files with x402 in just a few minutes. With x402, you monetize your private files by setting payment requirements. Payments go directly to your wallet. You control the price and receive the funds.Documentation Index
Fetch the complete documentation index at: https://docs.pinata.cloud/llms.txt
Use this file to discover all available pages before exploring further.
x402 is available on paid Pinata accounts. Upgrade your account to access x402 monetization features.
Prerequisites
- Paid Pinata account
- Pinata SDK installed
- Ethereum wallet address to receive payments
Step 1: Upload a Private File
First, upload a file to Private IPFS:cid for the next step.
Step 2: Create a Payment Instruction
Define your payment requirements:amount uses USDC’s smallest unit. USDC has 6 decimals, so to convert USD to the token amount, multiply by 1,000,000:
| USD Amount | amount | Calculation |
|---|---|---|
| $0.01 | "10000" | $0.01 × 1,000,000 |
| $0.10 | "100000" | $0.10 × 1,000,000 |
| $1.00 | "1000000" | $1.00 × 1,000,000 |
| $5.00 | "5000000" | $5.00 × 1,000,000 |
| $10.00 | "10000000" | $10.00 × 1,000,000 |
- Production: Use
"base"(or"eip155:8453") with0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - Testing: Use
"base-sepolia"(or"eip155:84532") with0x036CbD53842c5426634e7929541eC2318f3dCF7e
id for the next step.
Step 3: Attach CID to Payment Instruction
Link your private file to the payment instruction:Step 4: Share Your Monetized Content
Your file is now monetized! Share this URL with requesters:Replace
your-gateway.mypinata.cloud with your actual dedicated Pinata gateway domain (e.g., my-gateway.mypinata.cloud), and {cid} with your file’s CID.Step 5: Test the Payment Flow
When a requester accesses your URL without payment, the gateway returns a 402 response with payment requirements:X-Payment header.
Next Steps
- Manage Multiple Files: Attach multiple CIDs to the same payment instruction
- Update Pricing: Use
updatePaymentInstruction - Monitor Access: Check your gateway analytics to track paid downloads
- Requester Guide: Learn how requesters access paid content in the Accessing Paid Content guide