How I Built an Autonomous AI Agent That Earns USDC While I Sleep
Описание и применение
Автономный агент на VPS использует LLM для выполнения задач, оплачивает их через x402 и получает USDC, автоматически реинвестируя прибыль.
Задача
Developers want a repeatable, low‑cost system that autonomously performs a billable task, receives stablecoin payment, and reinvests profits without relying on proprietary SaaS.
Результат
The agent processed jobs continuously for three weeks on a single‑GPU VPS, earning USDC with minimal overhead and automatically reinvesting surplus.
Рабочий процесс
- 1. Pull job from Redis/SQLite queue
- 2. Execute job via LM adapter (OpenAI or local Llama‑2‑7B via TGI)
- 3. Build x402 payment payload and send request to protected endpoint
- 4. Receive 402 response, sign USDC transfer with wallet, retry request
- 5. Verify USDC receipt on Base, log profit, sweep excess to profit address
- 6. Sleep 5 s and repeat
Доказательства
The agent never holds more than the USDC needed to pay for the next call; any excess is swept to a separate “profit” address hourly.
I selected Llama‑2‑7B served via text‑generation‑inference (TGI) on a single‑GPU VPS.
- Дата записи: 2026-09-16T21:30:35.511Z