x402

Enable HTTP 402 micropayments for API calls on Celo.

8|4|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/celo-org/agent-skills --skill x402
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x402
Source: https://github.com/celo-org/agent-skills/tree/main/skills/x402
Command: npx skills add https://github.com/celo-org/agent-skills --skill x402

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the need for on-chain, pay-per-use payments for API calls by enabling HTTP 402 micropayments on Celo.

Core Features & Use Cases

  • HTTP 402 payment flow for API endpoints, enabling pay-per-use access to AI services.
  • Client-side and server-side integration with thirdweb x402 tooling for wrapFetchWithPayment and settlePayment workflows.
  • Supports native stablecoins on Celo (USDC, USDT, USDm) and sub-second settlement, enabling use cases like autonomous AI payments, paid data access, and pay-per-use API content.
  • Real-world example: an AI agent calls a paid API, signs the payment, and automatically retries with the settled payment.

Quick Start

  • Install and configure the thirdweb x402 client in your project.
  • Initialize a client with your clientId and connect a wallet.
  • Use wrapFetchWithPayment or useFetchWithPayment to perform paid API requests and automatically handle payments.

Frequently Asked Questions about x402

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

FAQPage Schema
How do I set up pay-per-use payments for API endpoints?

Pay-per-use API payments use HTTP 402 status codes to request payment before granting access. Install the thirdweb x402 client, initialize it with your clientId and wallet, then use wrapFetchWithPayment on the client side and settlePayment on the server to enable automatic micropayment flows for any API endpoint.

Can I use micropayments with stablecoins on Celo?

Yes, HTTP 402 micropayments on Celo support native stablecoins including USDC, USDT, and USDm with sub-second settlement finality, making them ideal for autonomous AI agents and paid API access without traditional payment infrastructure.

How do AI agents automatically handle paid API requests?

AI agents can call paid APIs using wrapFetchWithPayment, which signs the payment client-side and automatically retries the request after settlement. The thirdweb x402 tooling integrates payment signing and retry logic into the fetch workflow, enabling seamless autonomous transactions.

What's the difference between HTTP 402 micropayments and traditional payment methods?

HTTP 402 micropayments enable per-request on-chain settlement using stablecoins on Celo instead of recurring billing or subscription models. This approach suits content access and API calls where fine-grained, per-use pricing is required with fast finality and no intermediaries.

Do I need to manage wallet connections separately from payment flows?

No, the thirdweb x402 client handles wallet initialization as part of setup. Once connected with your clientId and wallet, payment signing and settlement are built into wrapFetchWithPayment and useFetchWithPayment, so payments and access control work together without separate integration.