buy

Pay for API calls on Solana with USDC via the x402 protocol.

9|2|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/AetherCore-Dev/ag402 --skill buy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: buy
Source: https://github.com/AetherCore-Dev/ag402/tree/main/.claude/skills/buy
Command: npx skills add https://github.com/AetherCore-Dev/ag402 --skill buy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ag402-core, ag402-client-mcp, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables AI agents to automatically pay for API calls using the x402 payment protocol, abstracting away the complexities of on-chain transactions.

Core Features & Use Cases

  • Automated API Payments: Seamlessly pay for API access in USDC on Solana with zero code changes.
  • Buyer-Side Integration: Configure agents to detect 402 Payment Required responses and handle payments transparently.
  • Use Case: An AI agent needs to access a premium weather API. This Skill ensures the agent automatically pays the API fee in USDC on Solana and receives the data, all without user intervention.

Quick Start

Set up your AI agent to auto-pay for API calls by running the ag402 setup command.

Frequently Asked Questions about buy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an AI agent pay for API calls automatically?

To make an AI agent pay for API calls automatically, configure it using the `ag402 setup` command to handle `402 Payment Required` responses, initiating USDC payments on Solana and retrying with proof.

How does the x402 payment protocol work for autonomous API access?

The x402 payment protocol works by returning a `402 Payment Required` response for premium APIs, which triggers the AI agent to autonomously execute an on-chain USDC payment on Solana and retry the original request with payment proof.

Can I use automated API payments with Claude Code or Cursor?

Yes, you can use automated API payments with Claude Code and Cursor. This Skill integrates via an MCP server to let AI agents transparently handle x402 payments for premium API access without user intervention.

Do I need a Solana wallet to handle 402 Payment Required responses?

Yes, handling `402 Payment Required` responses requires a Solana wallet configured to hold USDC. The agent autonomously uses this wallet to initiate on-chain payments and attach proof when retrying the API request.

How do I run x402 API payment scripts in Python?

To run x402 API payment scripts in Python, use the provided SDK or execute the `ag402 run` command. This initiates the autonomous on-chain USDC payment workflow to seamlessly access premium APIs.

What are the limitations of using AI agents for autonomous on-chain payments?

Limitations of using AI agents for autonomous on-chain payments include dependencies on the `ag402-core` and `ag402-client-mcp` modules, requiring a funded Solana wallet holding USDC, and strict reliance on APIs enforcing the x402 protocol.