Skip to main content

Overview

The Chainlink Price Oracle agent provides real-time cryptocurrency price data by reading Chainlink price feeds directly from Ethereum mainnet. It demonstrates on-chain data integration with an aixyz agent, gated behind x402 payments.

Project Structure

agent-chainlink/
  aixyz.config.ts           # Agent metadata and skills
  app/
    agent.ts                # Agent with Chainlink lookup tool
    tools/
      lookup.ts             # Chainlink price feed reader
    icon.png                # Agent icon
  package.json
  vercel.json

Skills

SkillDescription
Chainlink Price LookupLook up real-time cryptocurrency prices in USD using Chainlink feeds

Configuration

const config: AixyzConfig = {
  name: "Chainlink Price Oracle",
  description:
    "AI agent that provides real-time cryptocurrency price data using Chainlink price feeds on Ethereum mainnet.",
  version: "1.0.0",
  x402: {
    payTo: process.env.X402_PAY_TO!,
    network: process.env.X402_NETWORK!,
  },
};

Key Features

  • On-chain data — Reads directly from Chainlink price feeds on Ethereum mainnet
  • Symbol validation — Does not assume token symbols; validates via the tool
  • Environment-driven config — Payment address and network set via environment variables
  • Auto-generated server — No custom server.ts needed

Payment

The agent charges $0.01 per request via x402. Payment destination is configured via environment variables.

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key
X402_PAY_TOPayment destination address
X402_NETWORKPayment network (e.g., eip155:8453)

Running

cd examples/agent-chainlink
bun install
bun run dev