All projects

Pay-Per-Thought Agent

A verifiable AI research agent that pays for every reasoning step using Chainlink CRE micropayments.

CRE & AI DeFi & Tokenization

What it is

Pay-Per-Thought Agent is an autonomous research AI that executes reasoning as a sequence of paid, verifiable onchain actions using Chainlink CRE.

Today, AI agents operate as opaque black boxes: they call tools, APIs, and reasoning steps with no economic accountability. Users cannot control costs, providers cannot trust usage, and no verifiable audit trail exists.
This project introduces metered cognition, an agent that must economically justify every step it takes.

Instead of a single AI response, the agent:

  1. Plans a research strategy
  2. Breaks it into discrete steps (search, analysis, synthesis)
  3. Locks a user-defined budget onchain
  4. Authorizes each step individually
  5. Executes the tool
  6. Confirms execution onchain
  7. Settles the remaining budget

Each step is paid through an x402 micropayment smart contract and orchestrated by Chainlink CRE.

This creates a verifiable record proving:

  • What the AI did
  • Why it did it
  • How much it cost

The result is a trustworthy autonomous research assistant where users control spending and providers are guaranteed payment.

The system demonstrates a future where AI agents operate as economic actors onchain rather than uncontrolled API callers.

How it Works

Pay-Per-Thought Agent combines a Chainlink CRE workflow with an AI agent runtime and a web interface.

Core components

  1. Chainlink CRE Workflow
  • Defines the agent execution pipeline
  • Locks budget onchain
  • Authorizes each reasoning step
  • Confirms execution
  • Settles remaining funds
  1. x402 Payment Contract
  • Holds user budget
  • Releases payment per authorized step
  • Prevents unpaid tool usage
  • Provides verifiable accounting
  1. AI Agent Runtime
  • Planning (task decomposition)
  • Execution (tool usage)
  • Synthesis (final answer)
    Tools used:
    • Tavily search API (information retrieval)
    • Gemini LLM (analysis and synthesis)
  1. Backend API
  • Accepts research requests
  • Generates workflow payload
  • Executes CRE simulation
  • Parses workflow output
  1. Frontend
  • User enters research task and budget
  • Displays steps executed
  • Shows cost consumption
  • Shows final answer

Execution Flow
User -> API -> CRE Workflow -> Onchain budget lock -> Tool execution -> Onchain confirmation -> Final synthesis -> UI
Every step is tied to an economic authorization event.

Links

Created by

  • Sheriff Adebanjo