t2000-pay
1
总安装量
1
周安装量
#76621
全站排名
安装命令
npx skills add https://github.com/mission69b/t2000-skills --skill t2000-pay
Agent 安装分布
amp
1
cline
1
opencode
1
cursor
1
kimi-cli
1
codex
1
Skill 文档
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)
- Makes initial HTTP request to the URL
- If 402: reads PAYMENT-REQUIRED header for amount and terms
- If price ⤠–max-price: signs and broadcasts USDC payment on Sui
- Retries with X-PAYMENT proof header
- 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-priceINSUFFICIENT_BALANCE: not enough available USDCUNSUPPORTED_NETWORK: 402 requires a network other than SuiPAYMENT_EXPIRED: payment challenge has expiredDUPLICATE_PAYMENT: nonce already used on-chain