OpenPayment Skill
Creates x402 stablecoin payment links via the openpayment CLI.
All links are hosted at OpenPayment 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
CODEBLOCK0
Core Command
CODEBLOCK1
Required Flags
| Flag | Description | Example |
|---|
| INLINECODE1 | Payment type (see below) | INLINECODE2 |
| INLINECODE3 |
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 |
|---|
| INLINECODE10 | Payment description (max 500 chars) |
| INLINECODE11 |
Required when
--type is
PROXY; upstream API URL (
https://...) |
|
--json | Output as JSON instead of plain text |
Payment Types
| Type | When to use |
|---|
| INLINECODE16 | One-time payment with fixed price (e.g., a specific order, invoice) |
| INLINECODE17 |
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 | INLINECODE21 | 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: INLINECODE24
- Base Sepolia USDC: INLINECODE25
Support for other stablecoins and custom ERC-20 tokens will be added soon.
Example Commands
Basic single-use payment link (10 USDC on Base)
CODEBLOCK2
Crowdfund / donation (multi-use, suggest 1 USDC, user can change)
CODEBLOCK3
Recurring subscription (multi-use, fixed price)
CODEBLOCK4
Proxy payment link
CODEBLOCK5
Testnet payment link
CODEBLOCK6
JSON output (for scripting)
CODEBLOCK7
Output
Plain text:
CODEBLOCK8
Example:
CODEBLOCK9
JSON (--json):
CODEBLOCK10
Example:
CODEBLOCK11
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. - Infer defaults: type defaults to
SINGLE_USE, network defaults to eip155:8453 (Base Mainnet). - Confirm info with the user before creating.
- Run the command using the bash tool.
- 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 INLINECODE38 - INLINECODE39 : positive decimal number (e.g.
0.001, 10, 99.99) - INLINECODE43 : valid EVM address —
0x followed by 40 hex characters - INLINECODE45 : must be
eip155:8453 or INLINECODE47 - INLINECODE48 : optional string, max 500 characters
- INLINECODE49 : 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
OpenPayment 技能
通过 openpayment CLI 创建 x402 稳定币支付链接。
所有链接托管在 OpenPayment,并在 Base 网络上以 USDC 结算。
当用户想要创建支付链接、请求稳定币支付、设置加密支付、生成 USDC 支付 URL,或提及 x402、OpenPayment,或希望在 Base 上接收加密货币/稳定币付款时,请使用此技能。
即使用户说创建一个支付链接、我想接受 USDC、生成一个加密支付请求、用稳定币给我打钱或设置一个区块链支付等,也要触发此技能。
关于 OpenPayment
OpenPayment 让商家、创作者、开发者和 AI 代理能够通过可分享的支付链接和 API 接受 USDC 支付。0% 平台费用,即时结算到收款人钱包,无需注册。由 x402 提供技术支持。
安装
bash
npm i -g openpayment
核心命令
bash
openpayment create \
--type \
--price \
--payTo \
--network \
[--resourceUrl URLFOR_PROXY>] \
--description
必需标志
| 标志 | 描述 | 示例 |
|---|
| --type | 支付类型(见下文) | SINGLE_USE |
| --price |
人类可读的 USDC 金额 | 10 或 0.001 |
| --payTo | 收款人 EVM 钱包地址 | 0x1234...abcd |
| --network | CAIP-2 网络标识符 | eip155:8453 |
可选标志
| 标志 | 描述 |
|---|
| --description | 支付描述(最多 500 个字符) |
| --resourceUrl |
当 --type 为 PROXY 时必需;上游 API URL(https://...) |
| --json | 以 JSON 格式输出,而非纯文本 |
支付类型
| 类型 | 使用场景 |
|---|
| SINGLEUSE | 一次性固定价格支付(例如:特定订单、发票) |
| MULTIUSE |
固定价格,可多次支付(例如:周期性产品) |
| VARIABLE | 可重复使用的链接;付款人每次支付时选择金额(例如:小费、捐赠) |
| PROXY | 固定价格多次使用支付,成功结算后调用私有上游 API |
默认使用 SINGLE_USE,除非用户另有指定。
网络
| 网络 | 标志值 | 描述 |
|---|
| Base 主网 | eip155:8453 | 生产环境,真实 USDC |
| Base Sepolia |
eip155:84532 | 测试网,测试 USDC |
默认使用 eip155:8453(Base 主网),除非用户提到测试、测试网或sepolia。
其他网络的支持即将推出。
货币
默认货币为 USDC。
- - Base 主网 USDC:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
- Base Sepolia USDC:0x036CbD53842c5426634e7929541eC2318f3dCF7e
其他稳定币和自定义 ERC-20 代币的支持即将推出。
示例命令
基本一次性支付链接(Base 上 10 USDC)
bash
openpayment create \
--type SINGLE_USE \
--price 10 \
--payTo 0xYourWalletAddress \
--network eip155:8453 \
--description 订单 #123 的付款
众筹/捐赠(多次使用,建议 1 USDC,用户可更改)
bash
openpayment create \
--type VARIABLE \
--price 1 \
--payTo 0xYourWalletAddress \
--network eip155:8453 \
--description 支持我的工作
周期性订阅(多次使用,固定价格)
bash
openpayment create \
--type MULTI_USE \
--price 9.99 \
--payTo 0xYourWalletAddress \
--network eip155:8453 \
--description 月度订阅
代理支付链接
bash
openpayment create \
--type PROXY \
--price 10 \
--payTo 0xYourWalletAddress \
--network eip155:8453 \
--resourceUrl https://private-api.example.com/endpoint \
--description 代理支付
测试网支付链接
bash
openpayment create \
--type SINGLE_USE \
--price 5 \
--payTo 0xYourWalletAddress \
--network eip155:84532 \
--description 测试支付
JSON 输出(用于脚本)
bash
openpayment create \
--type SINGLE_USE \
--price 25 \
--payTo 0xYourWalletAddress \
--network eip155:8453 \
--json
输出
纯文本:
text
支付创建成功
paymentId:
url:
示例:
text
支付创建成功
paymentId: ed5b8e83-607b-4853-90c6-f4f3ba821424
url: https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424
JSON(--json):
json
{
paymentId: ,
url:
}
示例:
json
{
paymentId: ed5b8e83-607b-4853-90c6-f4f3ba821424,
url: https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424
}
处理用户请求的工作流程
首次运行此技能时,向用户解释允许的支付类型和网络。
- 1. 识别缺失信息:金额(--price)、收款人钱包地址(--payTo)。如果 --type=PROXY,还需要 --resourceUrl。
- 推断默认值:类型默认为 SINGLE_USE,网络默认为 eip155:8453(Base 主网)。
- 在创建前与用户确认信息。
- 使用 bash 工具运行命令。
- 清晰地向用户展示支付 URL,以便他们分享。
信息缺失时询问的内容
- - 没有钱包地址:收款人的 EVM 钱包地址是什么(以 0x 开头)?
- 没有金额:支付金额应该是多少 USDC?
- 未指定类型但上下文暗示多次使用:这个链接应该是单次使用(仅一次支付)还是可重复使用?,金额应该是固定的还是可编辑的?
- 未指定网络:假设为 Base 主网;在回复中提及。
- PROXY 没有上游 URL:请提供此代理支付的私有上游 API URL(--resourceUrl)。
验证规则(CLI 在任何 API 调用前强制执行)
- - --type:必须是 SINGLEUSE、MULTIUSE、VARIABLE 或 PROXY
- --price:正十进制数(例如 0.001、10、99.99)
- --payTo:有效的 EVM 地址——0x 后跟 40 个十六进制字符
- --network:必须是 eip155:8453 或 eip155:84532
- --description:可选字符串,最多 500 个字符
- --resourceUrl:仅对 PROXY 必需;必须是有效的 https:// URL
安全说明
切勿询问或分享用户的私钥和秘密。
了解更多
- - 网站:https://openpayment.link
- GitHub:https://github.com/noncept/openpayment