agentic-x402
БесплатноБез исполняемых скриптовНе проверенMake x402 payments to access gated APIs and content. Fetch paid resources, check wallet balance, and create payment links. Use when encountering 402 Payment…
от lxyeternal★ 68 звёзд на GitHubОб этом скилле
x402 Agent Skill
Pay for x402-gated APIs and content using USDC on Base. This skill enables agents to autonomously make crypto payments when accessing paid web resources.
Quick Reference
| Command | Description |
|---|---|
x402 setup |
Create or configure wallet |
x402 balance |
Check USDC and ETH balances |
x402 pay <url> |
Pay for a gated resource |
x402 fetch <url> |
Fetch with auto-payment |
x402 create-link |
Create payment link (seller) |
x402 link-info <addr> |
Get payment link details |
Installation
npm i -g agentic-x402
Once installed, the x402 command is available globally:
x402 --help
x402 --version
Setup
Run the interactive setup to create a new wallet:
x402 setup
This will:
- Generate a new wallet (recommended) or accept an existing key
- Save configuration to
~/.x402/.env - Display your wallet address for funding
Important: Back up your private key immediately after setup!
Manual Configuration
Alternatively, set the environment variable directly:
export EVM_PRIVATE_KEY=0x...your_private_key...
Or create a config file:
mkdir -p ~/.x402
echo "EVM_PRIVATE_KEY=0x..." > ~/.x402/.env
chmod 600 ~/.x402/.env
Verify setup:
x402 balance
Paying for Resources
When you encounter HTTP 402 Payment Required
Use x402 pay to make the payment and access the content:
x402 pay https://api.example.com/paid-endpoint
The command will:
- Check payment requirements
- Verify amount is within limits
- Process the payment
- Return the gated content
Automatic payment with fetch
Use x402 fetch for seamless payment handling:
x402 fetch https://api.example.com/data --json
This wraps fetch with x402 payment handling - if the resource requires payment, it's handled automatically.
Payment limits
By default, payments are limited to $10 USD. Override with --max:
x402 pay https://expensive-api.com/data --max 50
Or set globally:
export X402_MAX_PAYMENT_USD=25
Dry run
Preview payment without executing:
x402 pay https://api.example.com/data --dry-run
Creating Payment Links (Seller)
Create payment links to monetize your own content using x402-links-server:
Setup for link creation
Add to .env:
X402_LINKS_API_URL=https://your-x402-links-server.com
Create a link
Gate a URL:
x402 create-link --name "Premium API" --price 1.00 --url https://api.example.com/premium
Gate text content:
x402 create-link --name "Secret" --price 0.50 --text "The secret message..."
With webhook notification:
x402 create-link --name "Guide" --price 5.00 --url https://mysite.com/guide --webhook https://mysite.com/payment-hook
Get link info
x402 link-info 0x1234...5678
x402 link-info https://21.cash/pay/0x1234...5678
Command Reference
x402 balance
Check wallet balances.
x402 balance [--json] [--full]
| Flag | Description | Default |
|---|---|---|
--json |
Output as JSON (address, network, chainId, balances) | — |
--full |
Show full wallet address instead of truncated | — |
-h, --help |
Show help | — |
x402 pay
Pay for an x402-gated resource.
x402 pay <url> [options]
| Flag | Description | Default |
|---|---|---|
<url> |
The URL of the x402-gated resource (positional) | required |
--method |
HTTP method | GET |
--body |
Request body (for POST/PUT requests) | — |
--header |
Add custom header (can be used multiple times) | — |
--max |
Maximum payment in USD (overrides config) | from config |
--dry-run |
Show payment details without paying | — |
-h, --help |
Show help | — |
x402 fetch
Fetch with automatic payment.
x402 fetch <url> [options]
| Flag | Description | Default |
|---|---|---|
<url> |
The URL to fetch (positional) | required |
--method |
HTTP method | GET |
--body |
Request body (for POST/PUT) | — |
--header |
Add header as "Key: Value" |
— |
--json |
Output as JSON only (for piping to other tools) | — |
--raw |
Output raw response body only (no headers or status) | — |
-h, --help |
Show help | — |
x402 create-link
Create a payment link.
x402 create-link --name <name> --price <usd> [options]
| Flag | Description | Default |
|---|---|---|
--name |
Name of the payment link | required |
--price |
Price in USD (e.g., "5.00" or "0.10") |
required |
--url |
URL to gate behind payment | — |
--text |
Text content to gate behind payment | — |
--desc |
Description of the link | — |
--webhook |
Webhook URL for payment notifications | — |
--json |
Output as JSON | — |
-h, --help |
Show help | — |
Note: Either
--urlor--textis required. Th
Установить agentic-x402 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(x402:*)Bash(npm:*)ReadВложенные файлы
FAQ
Что делает скилл agentic-x402?
Make x402 payments to access gated APIs and content. Fetch paid resources, check wallet balance, and create payment links. Use when encountering 402 Payment Required responses or when the user wants to pay for web resources with crypto.
Как установить скилл agentic-x402?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agentic-x402 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic