Live Demo: https://pixl-agent-ten.vercel.app/
PixlAgent is a fully on-chain AI NFT generator and minting DApp built on Solana. Users pay a tiny micro-fee in USDC using FareMeter, and PixlAgent automatically generates a unique AI artwork, uploads it to IPFS, mints an NFT, and transfers it directly to the user’s wallet.
✅ AI-Generated Art – each NFT is unique
✅ Fully On-Chain Minting – token minted and transferred to your wallet
✅ IPFS Storage – permanent decentralized image + metadata
✅ Micro-Payments with FareMeter – pay only per mint
✅ Phantom Wallet Integration
✅ Professional UI with Dark Theme
✅ Works on Solana Devnet
| Component | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), React, TypeScript |
| Wallet | Phantom, Solana Wallet Adapter |
| Blockchain | Solana Web3.js, SPL Token, Metaplex |
| Payments | FareMeter (pay-per-mint) |
| AI Image Generation | Replicate API |
| Storage | Pinata IPFS |
| Styling | TailwindCSS |
Before running the project, install:
✅ Node.js 18+
✅ Phantom Wallet (browser extension)
✅ Git
git clone <repo-url>
cd pixl-agentnpm install
# or
yarn install
# or
pnpm installCreate a new .env.local file in the root folder and add:
# Your Solana wallet address that will receive payments
PAYTO_ADDRESS=your_solana_wallet_address_here
# FareMeter Configuration
FAREMETER_FACILITATOR_URL=https://facilitator.corbits.dev
FAREMETER_NETWORK=devnet
# Payment Configuration
ASSET=USDC
PAYMENT_AMOUNT=1000 # 0.001 USDC (6 decimals)
# IPFS Upload (Pinata)
PINATA_JWT=your_pinata_jwt_here
# Replicate AI Model Token (for image generation)
REPLICATE_API_TOKEN=your_replicate_api_token_here
# Private key of the NFT minting agent in array format
AGENT_PRIVATE_KEY=<solana private key json>
# Solana RPC endpoint
NEXT_PUBLIC_SOLANA_RPC=https://api.devnet.solana.com✅ If using your own wallet as the receiver, replace PAYTO_ADDRESS with your Phantom public key.
| Key | Where to get it |
|---|---|
| PINATA_JWT | https://www.pinata.cloud |
| REPLICATE_API_TOKEN | https://replicate.com/account/api-tokens |
| PAYTO_ADDRESS | Your Phantom wallet (Devnet) |
- Install Phantom extension
- Open settings → Developer Settings
- Set Network: Devnet
✅ Devnet USDC: https://faucet.circle.com ✅ Devnet SOL: https://faucet.solana.com
You need:
- A small amount of SOL (for fees)
- 0.001+ USDC per mint
npm run devOpen your browser:
- Connect Phantom wallet (Devnet)
- Get free Devnet SOL + USDC
- Go to Mint NFT
- Approve micro-payment in Phantom (0.001 USDC)
- NFT is generated, uploaded to IPFS, minted to your wallet
- View all owned NFTs in My NFTs tab
├── app/
│ ├── page.tsx # Main UI
│ ├── api/
│ │ └── mint/route.ts # Minting API + FareMeter middleware
├── components/
│ ├── MintNFT.tsx # Frontend mint UI
│ └── ViewNFTs.tsx # NFT gallery UI
├── lib/
│ └── faremeter-client.ts # FareMeter payment integration
├── public/
├── .env.local
└── package.json
✔ Generates AI image using Replicate ✔ Uploads image + metadata JSON to IPFS using Pinata ✔ Creates NFT mint via agent private key ✔ Sends NFT to user's wallet ✔ All paid for via FareMeter micro transaction
| Issue | Fix |
|---|---|
| Phantom not connecting | Refresh page after installing Phantom |
| "Insufficient USDC" | Get USDC from Circle faucet |
| NFT doesn't show in gallery | Check Phantom is on Devnet + refresh |
| Payment fails | Ensure USDC & SOL balances > 0 |