# Send Agentic X402 to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agentic-x402",
    "name": "Agentic X402",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/ya7ya/agentic-x402",
    "canonicalUrl": "https://clawhub.ai/ya7ya/agentic-x402",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/agentic-x402",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agentic-x402",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "bin/cli.ts",
      "bin/x402.js",
      "config/example.env",
      "package.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "agentic-x402",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T17:26:06.253Z",
      "expiresAt": "2026-05-06T17:26:06.253Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agentic-x402",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agentic-x402",
        "contentDisposition": "attachment; filename=\"agentic-x402-0.2.6.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "agentic-x402"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agentic-x402"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agentic-x402",
    "downloadUrl": "https://openagent3.xyz/downloads/agentic-x402",
    "agentUrl": "https://openagent3.xyz/skills/agentic-x402/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agentic-x402/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agentic-x402/agent.md"
  }
}
```
## Documentation

### 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

CommandDescriptionx402 setupCreate or configure walletx402 balanceCheck USDC and ETH balancesx402 pay <url>Pay for a gated resourcex402 fetch <url>Fetch with auto-paymentx402 create-linkCreate 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

### 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

### x402 balance

Check wallet balances.

x402 balance [--json] [--full]

FlagDescriptionDefault--jsonOutput as JSON (address, network, chainId, balances)—--fullShow full wallet address instead of truncated—-h, --helpShow help—

### x402 pay

Pay for an x402-gated resource.

x402 pay <url> [options]

FlagDescriptionDefault<url>The URL of the x402-gated resource (positional)required--methodHTTP methodGET--bodyRequest body (for POST/PUT requests)—--headerAdd custom header (can be used multiple times)—--maxMaximum payment in USD (overrides config)from config--dry-runShow payment details without paying—-h, --helpShow help—

### x402 fetch

Fetch with automatic payment.

x402 fetch <url> [options]

FlagDescriptionDefault<url>The URL to fetch (positional)required--methodHTTP methodGET--bodyRequest body (for POST/PUT)—--headerAdd header as "Key: Value"—--jsonOutput as JSON only (for piping to other tools)—--rawOutput raw response body only (no headers or status)—-h, --helpShow help—

### x402 create-link

Create a payment link.

x402 create-link --name <name> --price <usd> [options]

FlagDescriptionDefault--nameName of the payment linkrequired--pricePrice in USD (e.g., "5.00" or "0.10")required--urlURL to gate behind payment—--textText content to gate behind payment—--descDescription of the link—--webhookWebhook URL for payment notifications—--jsonOutput as JSON—-h, --helpShow help—

Note: Either --url or --text is required. The link is deployed as a smart contract on Base.

### x402 link-info

Get payment link details.

x402 link-info <router-address> [--json]

FlagDescriptionDefault<address>Router contract address or full payment URL (positional)required--jsonOutput as JSON—-h, --helpShow help—

### Environment Variables

VariableDescriptionDefaultEVM_PRIVATE_KEYWallet private key (0x-prefixed)requiredX402_NETWORKmainnet (Base, chain 8453) or testnet (Base Sepolia, chain 84532)mainnetX402_MAX_PAYMENT_USDSafety limit — payments exceeding this are rejected unless --max is used10X402_FACILITATOR_URLCustom facilitator URLCoinbase (mainnet) / x402.org (testnet)X402_SLIPPAGE_BPSSlippage tolerance in basis points (100 bps = 1%)50X402_VERBOSEEnable verbose logging (1 = on, 0 = off)0X402_LINKS_API_URLBase URL of x402-links-server (e.g., https://21.cash)—

### Supported Networks

NetworkChain IDCAIP-2 IDBase Mainnet8453eip155:8453Base Sepolia84532eip155:84532

### Payment Token

All payments use USDC (USD Coin) on the selected network.

Base Mainnet: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Base Sepolia: 0x036CbD53842c5426634e7929541eC2318f3dCF7e

### How x402 Works

Client requests a resource
Server responds with 402 Payment Required + payment details
Client signs a payment authorization (USDC transfer)
Client retries request with payment signature
Server verifies payment via facilitator
Server settles payment on-chain
Server returns the gated content

The x402 protocol is gasless for buyers - the facilitator sponsors gas fees.

### "Missing required environment variable: EVM_PRIVATE_KEY"

Set your wallet private key:

export EVM_PRIVATE_KEY=0x...

Or create a .env file in your working directory, or install globally and use ~/.x402/.env.

### "Payment exceeds max limit"

Increase the limit:

x402 pay https://... --max 50

### Low balance warnings

Fund your wallet with:

USDC for payments
ETH for gas (small amount, ~0.001 ETH)

### Network mismatch

Ensure your wallet has funds on the correct network:

X402_NETWORK=mainnet → Base mainnet
X402_NETWORK=testnet → Base Sepolia

### Backup Your Private Key

Your private key is stored in ~/.x402/.env. If lost, your funds cannot be recovered.

### Recommended Backup Methods

Password Manager (Recommended)

Store in 1Password, Bitwarden, or similar
Create a secure note with your private key
Tag it for easy retrieval



Encrypted File
# Encrypt with GPG
gpg -c ~/.x402/.env
# Creates ~/.x402/.env.gpg - store this backup securely



Paper Backup (for larger amounts)

Write down the private key
Store in a safe or safety deposit box
Never store digitally unencrypted

### View Your Private Key

cat ~/.x402/.env | grep EVM_PRIVATE_KEY

### Recovery

To restore from backup:

mkdir -p ~/.x402
echo "EVM_PRIVATE_KEY=0x...your_backed_up_key..." > ~/.x402/.env
chmod 600 ~/.x402/.env
x402 balance  # verify

### Security Best Practices

Use a dedicated wallet — Never use your main wallet with automated agents
Limit funds — Only transfer what you need for payments
Set payment limits — Configure X402_MAX_PAYMENT_USD to cap exposure
Test first — Use X402_NETWORK=testnet with test tokens before mainnet
Protect the config — ~/.x402/.env has 600 permissions; keep it that way
Never share — Your private key gives full access to your wallet

### Links

x402 Protocol Docs
x402 GitHub
npm: agentic-x402
Base Network
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: ya7ya
- Version: 0.2.6
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T17:26:06.253Z
- Expires at: 2026-05-06T17:26:06.253Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/agentic-x402)
- [Send to Agent page](https://openagent3.xyz/skills/agentic-x402/agent)
- [JSON manifest](https://openagent3.xyz/skills/agentic-x402/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/agentic-x402/agent.md)
- [Download page](https://openagent3.xyz/downloads/agentic-x402)