The first AI agent that autonomously buys what it needs β paying with real USDC.
Built for the Locus Paygentic Hackathon, ProcureBot demonstrates the future of machine-to-machine payments. Ask it anything in natural language; it routes to the best API provider, authorizes a micro-USDC payment via the Locus Machine Payments Protocol, and delivers the result β all in seconds.
ProcureBot lets a simple text prompt trigger a full AI procurement cycle:
"Get the current Solana price"
β Groq LLM routes to CoinGecko
β $0.01 USDC authorized & paid via Locus
β Live price data rendered in chat
β Receipt logged with txHash
No manual API key management. No manual payments. One wallet, your rules.
| Route | Page |
|---|---|
/ |
Landing Page β animated particle background, feature grid, CTA |
/dashboard |
3-column procurement dashboard β Policy Panel Β· Chat Β· Receipt Feed |
User prompt
β
βΌ
ββββββββββββββββββββββββββββββββ
β Groq LLM Router β β llama-3.3-70b-versatile
β "Which tool should I use?" β
ββββββββββββββββ¬ββββββββββββββββ
β
βββββββββΌβββββββββ
β Tool Selected β
βββββββββ¬βββββββββ
β
ββββββββββββββββΌββββββββββββββββββββββββββββββββ
β Locus Machine Payments Protocol β
β callWrappedEndpoint(provider, endpoint, {}) β
β β USDC micro-payment authorized β
β β API call executed β
β β txHash returned β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββΌβββββββββ
β Formatted β
β Response + β
β Receipt β
ββββββββββββββββββ
| Provider | What it does | Est. Cost |
|---|---|---|
| CoinGecko | Live crypto prices, market data, trending coins | $0.005β0.01 |
| Tavily | Real-time web research & news search | $0.01 |
| OpenAI DALLΒ·E | Image generation from prompts (rendered inline) | $0.025 |
| OpenAI Chat | GPT-4o-mini for analysis & writing | $0.01 |
| Groq | Llama 3.3 for routing + fast answers | Free |
| Replicate | Open source image/media models | $0.01+ |
| Perplexity | AI-powered web search | $0.01 |
git clone https://github.com/NeelShah1505/ProcureBot.git
cd ProcureBot/procurebot
npm installcp .env.example .env.localEdit .env.local:
# Required β get at https://beta.paywithlocus.com
LOCUS_API_KEY=claw_dev_YOUR_KEY_HERE
# Required for AI routing
GROQ_API_KEY=gsk_YOUR_GROQ_KEY
# Required for image generation
OPENAI_API_KEY=sk-YOUR_OPENAI_KEY
# Required for web research
TAVILY_API_KEY=tvly-YOUR_TAVILY_KEYnpm run devOpen http://localhost:3000 π
| Key | Where | Free tier? |
|---|---|---|
LOCUS_API_KEY |
beta.paywithlocus.com | Yes β hackathon credits |
GROQ_API_KEY |
console.groq.com | Yes |
OPENAI_API_KEY |
platform.openai.com | Paid |
TAVILY_API_KEY |
tavily.com | Yes β 1000 free/mo |
Fund your Locus wallet: After creating your account, send USDC on Base to your agent wallet address. The balance reflects live in the dashboard left panel.
Visit localhost:3000. Scroll through the marketing page (animated particle background). Click "Try ProcureBot β".
Top-right pill shows: β¦ Agent Connected Β· 4.374 USDC β
Click "SOL Price" card or type:
Get the current Solana price with 24h analysis
Watch the live thinking steps:
π§ Groq selected: coingecko_price β real-time market data neededπ³ Requesting $0.01 USDC spend authorizationβ¦π Calling CoinGecko APIβ¦β Success β formatting resultsβ¦πΈ Paid $0.01 USDC
Right panel: Session Spend +$0.01 Β· receipt card shows provider, endpoint, cost & timestamp.
Click "Gen Image" or type:
Generate an image of a futuristic robot paying with crypto on the blockchain
The actual rendered image appears inline in the chat bubble β not just a link.
In the left panel, click any policy value (e.g. $0.50 USDC next to Max/tx). An inline editor appears. Change it, press Enter to save or Escape to cancel.
Click "Research AI" or type:
What is the latest news about AI agents this week?
Tavily performs live web research and returns a structured summary with source links.
procurebot/
βββ app/
β βββ page.tsx # Landing page (scrollable)
β βββ dashboard/page.tsx # 3-column dashboard (viewport-locked)
β βββ layout.tsx # Root layout + Google Fonts
β βββ globals.css # Design tokens, animations, scrollbar
β βββ api/procure/route.ts # Core procurement API route
β βββ routeWithGroq() # LLM-powered tool selection
β βββ ruleBasedRoute() # Fallback regex router
β βββ fmtPrice/fmtImage/fmtTavilyβ¦ formatters
βββ components/
β βββ ProcureChat.tsx # Chat UI, markdown renderer, image handler
β βββ PolicyPanel.tsx # Left sidebar with inline-editable policies
β βββ ReceiptCard.tsx # Transaction receipt feed
β βββ LocusConnect.tsx # Live connection + balance pill
β βββ ui/
β βββ AnimatedBackground.tsx # Canvas: particles + glowing orbs
β βββ GlowCard.tsx
β βββ index.tsx
βββ lib/
βββ locus.ts # Locus SDK: getBalance, callWrappedEndpoint, groqChat
All spending is governed by policies enforced by the Locus platform:
| Policy | Default | Description |
|---|---|---|
| Max per tx | $0.50 USDC | Hard cap per single API call |
| Daily cap | $15.00 USDC | Maximum total spend per day |
| Auto-approve | < $0.10 USDC | Instant transactions under threshold |
| Providers | 6 enabled | CoinGecko, Tavily, OpenAI, Groq, Perplexity, Replicate |
Transactions above the auto-approve threshold return an
approvalUrlβ a manual confirmation link shown directly in the chat.
| Layer | Tech |
|---|---|
| Framework | Next.js 16.2.3 (Turbopack) |
| Language | TypeScript |
| Styling | Vanilla CSS + Tailwind v4 |
| Animations | CSS keyframes + HTML Canvas API |
| AI Routing | Groq β llama-3.3-70b-versatile |
| Payments | Locus Machine Payments Protocol (USDC on Base) |
| Icons | Lucide React |
The Locus Machine Payments Protocol wraps external APIs with an on-chain payment layer on Base (Ethereum L2). When ProcureBot calls:
await callWrappedEndpoint("coingecko", "simple-price", { ids: "solana", vs_currencies: "usd" })- Locus checks your agent wallet's USDC balance on Base
- If sufficient and within policy β spend is authorized
- The wrapped API call executes server-side
- A
txHashandcostare returned alongside the data - Your balance decreases by the exact fractional USDC cost
Every purchase is transparent, on-chain verifiable, and policy-governed.
Locus Paygentic Hackathon β Showcasing the power of machine-initiated micro-payments for AI agents.
"What if AI agents could pay for what they need, when they need it β just like a human with a credit card, but fully autonomous and on-chain?"
