x402-layer

Deploy monetized endpoints and pay for API access on Base and Solana networks.

2|Updated Dec 16, 2025
One-click install
npx skills add https://github.com/ivaavimusic/SGL_DOCS_2025 --skill x402-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x402-layer
Source: https://github.com/ivaavimusic/SGL_DOCS_2025/tree/main/x402-layer
Command: npx skills add https://github.com/ivaavimusic/SGL_DOCS_2025 --skill x402-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, eth_account, solders, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables AI agents to pay for API access and deploy monetized endpoints on Base and Solana networks.

Core Features & Use Cases

  • Deploy new monetized endpoints and manage access via 402 payments and credits.
  • Discover, list, and manage marketplace endpoints for consumer and provider workflows.
  • Support pay-per-request and credit-based access flows with marketplace integration and endpoint management.

Quick Start

  1. Install dependencies: pip install -r requirements.txt
  2. Configure wallet environment: export WALLET_ADDRESS="0xYourWalletAddress" and export PRIVATE_KEY="0xYourPrivateKey"
  3. Create an endpoint: python scripts/create_endpoint.py my-api "My API" https://api.example.com 0.01
  4. Pay for access (Base): python scripts/pay_base.py https://api.x402layer.cc/e/weather-data
  5. Top up credits for your endpoint: python scripts/topup_endpoint.py my-api 10
  6. Discover services: python scripts/discover_marketplace.py

Frequently Asked Questions about x402-layer

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

FAQPage Schema
How do AI agents pay for API access using USDC on Base and Solana?

AI agents pay for API access using USDC on Base and Solana by utilizing the 402 payment protocol with EIP-712 signatures. This Skill provides Python scripts to execute pay-per-request transactions and manage credit-based access flows.

How do I create and monetize an API endpoint with the 402 payment protocol?

You create and monetize an API endpoint by running the included create_endpoint.py script with your API URL and desired USDC price. This deploys your endpoint to the marketplace, enabling 402 payment processing for consumer access.

Does this Skill require a specific Python environment or wallet configuration?

Yes, this Skill requires Python 3 along with dependencies like requests, eth_account, and solders. You must configure your wallet environment by exporting your WALLET_ADDRESS and PRIVATE_KEY before executing the payment and deployment scripts.

What is the difference between pay-per-request and credit-based endpoint access?

Pay-per-request access charges USDC per individual API call via the 402 protocol, while credit-based access allows consumers to top up endpoint credits in advance using scripts like topup_endpoint.py for bulk usage.

How do I discover available API services in the x402 marketplace?

You discover available API services in the x402 marketplace by running the discover_marketplace.py script. This lists all active monetized endpoints deployed on the Base and Solana networks for consumer integration.

Can I use EIP-712 signatures to automate USDC micropayments for endpoint deployment?

Yes, EIP-712 signatures are used to automate USDC micropayments for endpoint deployment. The Skill leverages this standard within the 402 payment protocol to facilitate secure, machine-readable transactions on the Base network.