uniswap-pay-with-any-token

创作者:Uniswap Labs
1
25

简介

For Developers

Let your AI agent pay for any service using whatever token it holds — no manual steps, no token pre-conversion needed.

  • Automatically handles the full flow: detect payment challenge → swap token → settle payment
  • Works with any ERC-20 token in the agent's wallet — no need to hold the exact payment token in advance
  • Supports MPP (Machine Payment Protocol) and x402 payment protocols
uniswap
payments
x402
mpp
tempo
defi
ethereum

SKILL.md

Uniswap Pay With Any Token

Enable AI agents to autonomously respond to payment-gated APIs using any ERC-20 token in their wallet.

Prerequisites

  • claude plugin add @uniswap/uniswap-trading or npx skills add Uniswap/uniswap-ai installed
  • Tempo CLI installed
  • A funded agent wallet configured with at least one ERC-20 token

When to Use This Skill

Use this skill when the user:

  • Is building an AI agent that needs to access APIs or services that require token payment
  • Wants to automate the swap-then-pay flow from an agent wallet
  • Asks about MPP (Machine Payment Protocol) or x402 payment flows
  • Wants an agent to handle payments autonomously without human intervention

How It Works

Some APIs and services gate access behind a payment challenge — they return a payment-required response before serving any data. This skill handles that challenge end-to-end: it detects the required token and amount, calls the Uniswap Trading API to swap whatever token the agent holds into the required payment token, then uses Tempo CLI to settle the payment via MPP or x402 protocol. The swap and settlement steps are coordinated automatically — the agent never needs to pause for human input.

Key commands:

  • tempo pay — Settle an MPP/x402 payment challenge via Tempo CLI
  • Trading API POST /quote — Get swap quote for token conversion
  • Trading API POST /swap — Execute the token swap before settlement