How I Built an Autonomous AI Agent That Earns USDC While I Sleep
Description and use
An autonomous agent that fetches new job postings, summarizes them using an LLM, and earns USDC on Base L2, running unattended on a VPS.
Problem
Create a minimal, self‑contained AI agent that can autonomously perform a task, receive payment in USDC on Base L2, and run unattended on a cheap VPS.
Outcome
The agent successfully runs unattended on a VPS, summarizing new job postings every 5 minutes and earning approximately $0.02 USDC per summary, demonstrating a viable micro‑payment loop on Base L2.
Workflow
- Set up a scheduler (cron/APScheduler) to trigger every 5 minutes.
- Implement the agent loop following ReAct: perceive → think → act.
- Perceive: fetch new items from a public RSS feed and parse into a list of job postings.
- Think: prompt OpenAI’s gpt‑3.5‑turbo to produce a one‑sentence summary for each posting.
- Act: send the summary to an x402‑protected HTTP endpoint, attaching a payment receipt.
- Record the earned USDC in a local state store (SQLite) and optionally verify the payment via x402 client.
- Repeat the cycle until no new postings are found or a termination condition is met.
Evidence
I wanted a minimal, self‑contained agent that could perform a useful task, receive payment in USDC on the Base L2, and run unattended on a cheap VPS.
Base offers low transaction fees (≈ $0.0001 per tx) and fast finality, making micro‑payments feasible.
- Record date: 2026-09-15T05:47:07.687Z