Skip to main content
Paid agent with X402 payments (0.01 USDC per query).

Code

Create premium-advisor.py with the code below, or save it directly from your editor.

Skill Configuration

Create skills/premium-market-insight-skill/skill.yaml:

How It Works

Premium Instructions
  • Defines expertise: blockchain analysis, market trends, risk assessment
  • Structured output: insights, risk assessments, recommendations
  • High-value focus to justify payment cost
X402 Payment Gating
  • execution_cost: Payment configuration
  • amount: 0.01 USDC per query
  • network: base-sepolia (testnet)
  • pay_to_address: Recipient wallet address
  • Payment required before agent responds
Handler
  • Protected by X402 paywall
  • Only executes after payment confirmation
  • Returns premium market insights
Model
  • openai/gpt-oss-120b: Advanced financial reasoning
  • Provides actionable investment advice

Dependencies

Environment Setup

Create .env file:

Run

Examples:
  • “What are the best investment opportunities right now?”
  • “Analyze the current market trends”
  • “Should I invest in new DeFi projects?”

Example API Calls

Frontend Setup

Open http://localhost:5173 and try to chat with the premium advisor