t2000-pay

SKILL.md

t2000: Pay for x402 API Service

Status

✅ Active — requires t2000 CLI with @t2000/x402 installed.

Purpose

Make a paid HTTP request to any x402-protected endpoint. Handles the 402 handshake, signs the USDC payment from the available balance, and returns the API response.

Command

t2000 pay <url> [options]

# Examples:
t2000 pay https://api.example.com/data
t2000 pay https://api.example.com/analyze --method POST --data '{"text":"hello"}'
t2000 pay https://api.example.com/premium --max-price 0.10
t2000 pay https://api.example.com/data --dry-run
t2000 pay https://api.example.com/data --header 'X-Custom=value' --timeout 60

Options

Option Description Default
--method <method> HTTP method (GET, POST, PUT) GET
--data <json> Request body for POST/PUT
--max-price <amount> Max USDC per request $1.00
--header <key=value> Additional HTTP header (repeatable)
--timeout <seconds> Request timeout in seconds 30
--dry-run Show what would be paid without paying

Flow (automatic)

  1. Makes initial HTTP request to the URL
  2. If 402: reads PAYMENT-REQUIRED header for amount and terms
  3. If price ≤ --max-price: signs and broadcasts USDC payment on Sui
  4. Retries with X-PAYMENT proof header
  5. Returns the API response body

Safety

  • If requested price exceeds --max-price, payment is refused (no funds spent)
  • Default max-price: $1.00 USDC per request
  • Payment only broadcast after 402 terms are validated

Errors

  • PRICE_EXCEEDS_LIMIT: API asking more than --max-price
  • INSUFFICIENT_BALANCE: not enough available USDC
  • UNSUPPORTED_NETWORK: 402 requires a network other than Sui
  • PAYMENT_EXPIRED: payment challenge has expired
  • DUPLICATE_PAYMENT: nonce already used on-chain
Weekly Installs
16
GitHub Stars
9
First Seen
Feb 28, 2026
Installed on
opencode16
codex16
mcpjam15
claude-code15
windsurf15
zencoder15