Create x402 USDC payment links using the OpenPayment CLI.
---
name: openpayment
description: Create x402 USDC payment links using the OpenPayment CLI.
metadata:
openclaw:
requires:
bins:
- openpayment
install:
- kind: node
package: openpayment
bins:
- openpayment
homepage: https://openpayment.link
---
# OpenPayment Skill
Creates x402 stablecoin payment links via the `openpayment` CLI.
All links are hosted at [OpenPayment](https://openpayment.link) and settle in USDC on Base.
Use this skill whenever a user wants to create a payment link, request a stablecoin payment, set up a crypto payment, generate a USDC payment URL, or mentions x402, OpenPayment, or wants to get paid in crypto/stablecoins on Base.
Trigger even if the user says things like "create a payment link", "I want to accept USDC", "generate a crypto payment request", "send me money in stablecoins", or "set up a blockchain payment".
## About OpenPayment
OpenPayment lets merchants, creators, developers, and AI agents accept USDC payments with shareable payment links and APIs. 0% platform fees, instant settlement to recipient wallet, and no sign-up required. Powered by x402.
## Install
```bash
npm i -g openpayment
```
## Core Command
```bash
openpayment create \
--type "<PAYMENT_TYPE>" \
--price "<AMOUNT>" \
--payTo "<EVM_ADDRESS>" \
--network "<NETWORK>" \
[--resourceUrl "<HTTPS_URL_FOR_PROXY>"] \
--description "<DESCRIPTION>"
```
### Required Flags
| Flag | Description | Example |
| ----------- | ----------------------------- | --------------- |
| `--type` | Payment type (see below) | `SINGLE_USE` |
| `--price` | Amount in human-readable USDC | `10` or `0.001` |
| `--payTo` | Recipient EVM wallet address | `0x1234...abcd` |
| `--network` | CAIP-2 network identifier | `eip155:8453` |
### Optional Flags
| Flag | Description |
| --------------- | ------------------------------------------------------------------- |
| `--description` | Payment description (max 500 chars) |
| `--resourceUrl` | Required when `--type` is `PROXY`; upstream API URL (`https://...`) |
| `--json` | Output as JSON instead of plain text |
## Payment Types
| Type | When to use |
| ------------ | ------------------------------------------------------------------------------------------- |
| `SINGLE_USE` | One-time payment with fixed price (e.g., a specific order, invoice) |
| `MULTI_USE` | Fixed price, can be paid multiple times (e.g., recurring product) |
| `VARIABLE` | Reusable link; payer chooses amount per payment (e.g., tips, donations) |
| `PROXY` | Fixed-price multi-use payment that calls a private upstream API after successful settlement |
**Default to `SINGLE_USE`** unless the user specifies otherwise.
## Networks
| Network | Flag value | Description |
| ------------ | -------------- | --------------------- |
| Base Mainnet | `eip155:8453` | Production, real USDC |
| Base Sepolia | `eip155:84532` | Testnet, test USDC |
**Default to `eip155:8453` (Base Mainnet)** unless the user says "test", "testnet", or "sepolia".
Support for other networks will be added soon.
## Currency
The default currency is **USDC**.
- Base Mainnet USDC: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
- Base Sepolia USDC: `0x036CbD53842c5426634e7929541eC2318f3dCF7e`
Support for other stablecoins and custom ERC-20 tokens will be added soon.
## Example Commands
### Basic single-use payment link (10 USDC on Base)
```bash
openpayment create \
--type "SINGLE_USE" \
--price "10" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Payment for order #123"
```
### Crowdfund / donation (multi-use, suggest 1 USDC, user can change)
```bash
openpayment create \
--type "VARIABLE" \
--price "1" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Support my work"
```
### Recurring subscription (multi-use, fixed price)
```bash
openpayment create \
--type "MULTI_USE" \
--price "9.99" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Monthly subscription"
```
### Proxy payment link
```bash
openpayment create \
--type "PROXY" \
--price "10" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--resourceUrl "https://private-api.example.com/endpoint" \
--description "Proxy payment"
```
### Testnet payment link
```bash
openpayment create \
--type "SINGLE_USE" \
--price "5" \
--payTo "0xYourWalletAddress" \
--network "eip155:84532" \
--description "Test payment"
```
### JSON output (for scripting)
```bash
openpayment create \
--type "SINGLE_USE" \
--price "25" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--json
```
## Output
**Plain text:**
```text
Payment created successfully
paymentId: <paymentId>
url: <paymentUrl>
```
Example:
```text
Payment created successfully
paymentId: ed5b8e83-607b-4853-90c6-f4f3ba821424
url: https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424
```
**JSON (`--json`):**
```json
{
"paymentId": "<paymentId>",
"url": "<paymentUrl>"
}
```
Example:
```json
{
"paymentId": "ed5b8e83-607b-4853-90c6-f4f3ba821424",
"url": "https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424"
}
```
## Workflow for Handling User Requests
The first time the skill runs, explain to the user what payment types and networks are allowed.
1. **Identify missing info** you need: amount (`--price`), receiver wallet address (`--payTo`). If `--type=PROXY`, also require `--resourceUrl`.
2. **Infer defaults**: type defaults to `SINGLE_USE`, network defaults to `eip155:8453` (Base Mainnet).
3. **Confirm info** with the user before creating.
4. **Run the command** using the bash tool.
5. **Present the payment URL** clearly to the user so they can share it.
### What to ask if info is missing
- **No wallet address**: "What's the recipient EVM wallet address (starting with 0x)?"
- **No amount**: "How much USDC should the payment be for?"
- **No type specified but context suggests multi-use**: "Should this link be single-use (one payment only) or reusable?", "Should the amount be fixed or editable?"
- **No network specified**: assume Base Mainnet; mention it in your response.
- **PROXY without upstream URL**: "Please provide the private upstream API URL for this proxy payment (`--resourceUrl`)."
## Validation Rules (enforced by CLI before any API call)
- `--type`: must be `SINGLE_USE`, `MULTI_USE`, `VARIABLE`, or `PROXY`
- `--price`: positive decimal number (e.g. `0.001`, `10`, `99.99`)
- `--payTo`: valid EVM address — `0x` followed by 40 hex characters
- `--network`: must be `eip155:8453` or `eip155:84532`
- `--description`: optional string, max 500 characters
- `--resourceUrl`: required only for `PROXY`; must be a valid `https://` URL
## Security Notes
Never ask for or share user private keys and secrets.
## Learn More
- Website: https://openpayment.link
- GitHub: https://github.com/noncept/openpayment
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit inputs section with tool and parameter requirements, broke procedure into 7 numbered atomic steps with clear input/output per step, extracted implicit decision logic (payment type inference, network defaults, missing data handling, PROXY validation) into dedicated decision points section, added edge case coverage (rate limits, CLI timeout, address validation, price constraints), formalized output contract with success/error formats, and defined outcome signal as user-observable link accessibility and settlement confirmation.
generate shareable USDC payment links on Base via the openpayment CLI. use this whenever a user wants to request stablecoin payment, create a payment link, accept crypto, or mentions x402, payment requests, or blockchain payments. covers one-time charges, recurring payments, variable-amount donations, and proxy settlements that trigger upstream APIs after payment clears.
required external tool:
npm i -g openpaymentrequired parameters from user:
--price: amount in USDC (decimal, e.g. 10 or 0.001)--payTo: recipient EVM wallet address (format: 0x + 40 hex chars)--type: payment model - SINGLE_USE, MULTI_USE, VARIABLE, or PROXY--network: blockchain target - eip155:8453 (Base Mainnet, production) or eip155:84532 (Base Sepolia, testnet)optional parameters:
--description: payment label, max 500 chars (e.g. "invoice #456", "monthly sub")--resourceUrl: upstream API endpoint (HTTPS only), required only if --type is PROXY--json: output structured JSON instead of plain textedge cases to handle:
gather parameters: ask user for missing --price, --payTo, and clarify --type if context is ambiguous. default --type to SINGLE_USE and --network to eip155:8453 unless stated otherwise.
validate inputs before execution:
--price: positive decimal, at least 0.001 USDC (reject negative, zero, or non-numeric)--payTo: match pattern 0x[0-9a-fA-F]{40} (valid EVM address)--type: one of SINGLE_USE, MULTI_USE, VARIABLE, PROXY--network: one of eip155:8453, eip155:84532--description: if provided, enforce 500-char max--resourceUrl: if --type=PROXY, require valid HTTPS URL; reject HTTPconfirm with user: repeat back the payment type, amount, recipient, network, and description before running the command.
execute CLI command: run openpayment create with all validated flags.
parse response: extract paymentId and url from output (plain text or JSON). timeout after 30 seconds if no response.
present payment URL: display the full shareable link (https://openpayment.link/pay/?paymentId=...) prominently so user can copy and share. include the paymentId for reference.
handle errors: if command fails, report the CLI error message and suggest remedies (invalid address format, network unreachable, rate limit exceeded, etc.).
if user does not specify a payment type:
SINGLE_USEMULTI_USE) or let payer choose amount (VARIABLE)?"PROXYif user does not specify a network:
eip155:8453 (Base Mainnet, production USDC)eip155:84532 (Base Sepolia testnet USDC)if --type=PROXY but no --resourceUrl provided:
if price is invalid (negative, zero, non-numeric, or too many decimals):
10 or 0.001)"if wallet address fails validation:
0x followed by 40 hex characters"if CLI times out or network is unreachable:
if rate limit hit (>10 requests per minute from same IP):
plain text response (default):
Payment created successfully
paymentId: <UUID>
url: https://openpayment.link/pay/?paymentId=<UUID>
JSON response (when --json flag used):
{
"paymentId": "<UUID>",
"url": "https://openpayment.link/pay/?paymentId=<UUID>"
}
success criteria:
error response (CLI returns non-zero exit code):
user has a working, shareable payment link they can immediately copy and distribute. they should be able to click the link in a browser and see the payment prompt (amount in USDC, wallet connect flow). payment should settle to the specified recipient address on Base within 1-2 block confirmations (roughly 2-4 seconds). user can verify settlement by checking recipient wallet or the payment dashboard at openpayment.link.