pay-for-http-request

작성자: stripe

purl 명령줄 인터페이스를 사용하여 자동 x402 결제 지원으로 HTTP 요청을 만듭니다.

npx skills add https://github.com/stripe/purl --skill pay-for-http-request

pay-for-http-request

Make HTTP requests with automatic x402 payment support using purl.

Description

This skill enables making HTTP requests to payment-gated APIs using purl, a curl-like CLI tool that automatically handles x402-based payments on EVM and Solana networks.

When to Use This Skill

When an API returns HTTP 402 (Payment Required) and supports the x402 payment protocol, purl can automatically negotiate and execute the payment to access the resource.

Common Scenarios

ScenarioExample
Tool callsPaying per request to an API service
Premium data feedsAccessing real-time market data, weather, or analytics
Content monetizationPaying to access paywalled articles or media
Compute resourcesOn-demand access to compute or storage services

When NOT to Use

  • Regular HTTP requests that don't require payment (use curl instead)
  • APIs using traditional payment methods (credit cards, API keys with billing)

Usage

purl <URL> [OPTIONS]
purl <COMMAND>

Commands

CommandDescription
walletManage wallets (keystores)
configManage configuration
balanceCheck wallet balance
inspectInspect payment requirements without executing
networksManage and inspect supported networks
versionShow version information
completionsGenerate shell completions script
topicsDisplay help topics (exit-codes, formatting, examples, environment)

Request Options

Payment Options

OptionDescription
--max-amount <AMOUNT>Maximum amount willing to pay (in atomic units)
--confirmRequire confirmation before paying
--network <NETWORKS>Filter to specific networks (comma-separated)
--dry-runPreview payment without executing

Display Options

OptionDescription
-v, --verbosityVerbosity level (can be used multiple times: -v, -vv, -vvv)
-q, --quiet / -s, --silentDo not print log messages
-i, --includeInclude HTTP headers in output
-I, --headShow only HTTP headers
-o, --output <FILE>Write output to file
--output-format <FORMAT>Output format: auto, text, json, yaml (auto detects: text for terminal, json for pipes)
--color <MODE>Control color output: auto, always, never

HTTP Options

OptionDescription
-X, --request <METHOD>Custom request method
-H, --header <HEADER>Add custom header
-A, --user-agent <AGENT>Set user agent
-L, --locationFollow redirects
--connect-timeout <SECONDS>Connection timeout in seconds
-m, --max-time <SECONDS>Maximum time for the request
-d, --data <DATA>POST data
--json <JSON>Send JSON data with Content-Type header

Wallet Options

OptionDescription
--wallet <PATH>Path to wallet file
--password <PASSWORD>Password for wallet decryption
--private-key <KEY>Raw private key (hex, for EVM; use wallet for better security)

Global Options

OptionDescription
-C, --config <PATH>Configuration file path

Wallet Commands

purl wallet <COMMAND>
CommandDescription
listList available wallets
addCreate a new wallet (interactive)
show <NAME>Show wallet details
verify <NAME>Verify wallet integrity
use <NAME>Set a wallet as the active payment method
remove <NAME>Remove a wallet

Wallet Add Options

OptionDescription
-n, --name <NAME>Name for the wallet
-t, --type <TYPE>Wallet type: evm or solana
-k, --private-key <KEY>Private key to import (hex for EVM, base58 for Solana)

Config Commands

purl config [COMMAND]
CommandDescription
(none)Show current config
get <KEY>Get a specific configuration value (supports dot notation)
validateValidate configuration file

Examples

Basic payment request

purl https://api.example.com/premium-data

Preview payment without executing

purl --dry-run https://api.example.com/data

Require confirmation before payment

purl --confirm https://api.example.com/data

Set maximum payment amount

purl --max-amount 10000 https://api.example.com/data

Filter to specific network

purl --network base-sepolia https://api.example.com/data

Verbose output with headers

purl -vi https://api.example.com/data

Save output to file as JSON

purl -o output.json --output-format json https://api.example.com/data

POST request with JSON data

purl --json '{"key": "value"}' https://api.example.com/data

Custom headers

purl -H "Authorization: Bearer token" https://api.example.com/data

Follow redirects with custom method

purl -L -X POST https://api.example.com/data

Check wallet balance

purl balance
purl balance --network base

Inspect payment requirements

purl inspect https://api.example.com/endpoint

Wallet management

purl wallet add                      # Interactive wallet creation
purl wallet add --type evm           # Skip type selection
purl wallet add --type solana -k KEY # Import existing key
purl wallet list                     # List all wallets
purl wallet use my-wallet            # Switch active wallet

View supported networks

purl networks
purl networks info base

Supported Networks

TypeNetworks
EVMethereum, ethereum-sepolia, base, base-sepolia, avalanche, avalanche-fuji, polygon, arbitrum, optimism
SVMsolana, solana-devnet

Prerequisites

  1. Create a wallet: purl wallet add
  2. Set up a payment method (wallet) with funds on the desired network
  3. Ensure the target API supports x402 payment protocol

Environment Variables

VariableDescription
PURL_MAX_AMOUNTDefault maximum amount willing to pay
PURL_NETWORKDefault network filter
PURL_CONFIRMDefault confirmation behavior (true/false)
PURL_KEYSTOREDefault wallet/keystore path
PURL_PASSWORDWallet password (for non-interactive use)

stripe의 다른 스킬

connect-required-verification-information
stripe
사용자가 Stripe Connect 연결 계정이 검증, 온보딩, KYC 또는 계정 요구사항을 위해 제공해야 하는 정보가 무엇인지 물을 때 이 스킬을 사용하십시오;…
stripe-apps
stripe
Stripe App을 구축, 수정 또는 검토할 때 사용합니다. 또는 사용자가 Stripe App을 암시하는 내용을 설명하는 경우(예: "고객 페이지에 패널 추가",…
stripe-directory
stripe
사용자가 특정 업종, 워크플로우, 문제점, 역량 또는 수행할 작업에 대해 비즈니스, 소프트웨어, 서비스 제공자 또는 파트너를 찾고자 할 때 사용합니다.
stripe-docs
stripe
사용자 또는 에이전트가 Stripe 문서나 API 참조를 읽거나, 검색하거나, 조회해야 할 때 사용합니다. docs.stripe.com...에 대해서는 curl이나 WebFetch보다 이 기능을 선호합니다.
stripe-projects
stripe
Stripe Projects CLI 플러그인을 사용하여 타사 서비스를 프로비저닝하고 API 키/토큰을 검색합니다.
connect-recommend
stripe
사용자가 Stripe Connect 설정, 결제 패턴, Dashboard 접근, 또는 Connect 시작 방법에 대해 물어보거나, 빌드 중일 때 이 스킬을 사용하세요…
stripe-best-practices
stripe
Stripe 통합 결정을 안내합니다: API 선택(Checkout Sessions vs PaymentIntents), Connect 플랫폼 설정(Accounts v2, 컨트롤러 속성),…
stripe-docs
stripe
사용자나 에이전트가 Stripe 문서 또는 API 참조를 읽거나, 검색하거나, 조회해야 할 때 사용합니다. docs.stripe.com…의 경우 curl이나 WebFetch보다 이 기능을 우선 사용하세요.