Buy storage
Storage
Buy storage
This api will help you rent units of storage for an year for a specific FID. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links. Requires x-wallet-id header.
POST
Buy storage
Node.js SDK
๐ SDK Method: buyStorage Use this API endpoint with the Neynar Node.js SDK for typed responses and better developer experience.Related documentation:
- Managing Onchain Wallets - Wallet setup guide
- Storage documentation - Understanding storage
Understanding Wallet ID for Storage Purchases
This endpoint allows you to purchase storage units for a specific FID (Farcaster ID). Storage units enable users to store more casts, reactions, and links on the Farcaster protocol.Wallet ID (REQUIRED)
Thex-wallet-id header is required for this endpoint. You must provide a wallet_id to pay for the onchain storage purchase transaction.
New to Wallet IDs? See Managing Onchain Wallets to create your app wallet in the developer portal and obtain your
x-wallet-id value.Code Examples
What Youโre Paying For
When you buy storage with a wallet_id:- Transaction Execution: Neynar handles gas estimation, retries, and monitoring
Storage Units Explained
Each storage unit you purchase provides:| Resource | Capacity per Unit |
|---|---|
| Casts | 5,000 casts |
| Reactions | 2,500 reactions |
| Links | 2,500 links (follows, etc.) |
- Duration: 1 year from purchase
- Network: Optimism mainnet
- Renewal: Must be renewed annually
Error Handling
Error: Missing Wallet ID
x-wallet-id header. See Managing Onchain Wallets for setup instructions.
Error: Invalid Wallet ID
Error: Insufficient Wallet Balance
Next Steps
Check Current Storage
View storage allocations for a user
Monitor Usage
Track storage consumption
Manage Your Wallet
Fund your wallet and monitor balance
Contact Support
Need help? Reach out to our team
Authorizations
API key to authorize requests
Headers
Wallet ID to use for transactions
Body
application/json
The unique identifier of a farcaster user or app (unsigned integer)
Required range:
x >= 1Example:
1
An Idempotency key is a unique identifier for the request. Note:
- This is used to prevent duplicate requests. Use the same idem key on retry attempts.
- This should be a unique identifier for each request.
- Recommended format is a 16-character string generated by the developer at the time of making this request.
Number of storage units to buy. A storage unit lets you store 5000 casts, 2500 reactions and 2500 links.
Required range:
x >= 1Example:
1