Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Built an Autonomous AI Agent That Earns USDC While I Sleep

Description and use

An autonomous LLM‑powered agent that processes jobs and earns USDC on Base L2 using x402 escrow, running continuously without human triggers.

Problem

Developers want to run a language‑model‑powered micro‑service that autonomously performs tasks and gets paid in USDC on Base L2 without human intervention.

Outcome

The agent autonomously processes jobs, settles payments in USDC on Base L2, and can scale by swapping SQLite for Postgres or KV.

Workflow

  • 1. Scheduler pulls pending jobs from durable store (Cloudflare KV or Postgres).
  • 2. Before LLM call, payment wrapper locks agreed USDC in x402 escrow contract.
  • 3. LLM (Together.ai Llama‑3‑8B) processes job using function‑calling schema for tools like summarize_text, extract_entities, run_sql_query.
  • 4. Tool executor runs deterministic function and returns result.
  • 5. Payment wrapper releases escrowed USDC to agent wallet after tool success.
  • 6. Persist job state, receipts, and nonce to prevent replay attacks in SQLite/KV.

Evidence

The agent does not need a human to trigger it; it runs continuously, checks for pending work, performs the task, collects payment, and repeats.

Source

I used a hosted Open‑source model via Together.ai (Llama‑3‑8B) because it offers a predictable per‑token cost and can be called from a Worker without cold‑start penalties.

Source

  • Record date: 2026-09-14T06:01:06.242Z