Integrates Nevermined payment infrastructure into AI agents, MCP servers, Google A2A agents, and REST APIs. Handles x402 protocol, credit billing, payment plans, and SDK integration for TypeScript (@nevermined-io/payments) and Python (payments-py).
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install nevermined-payments或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install nevermined-payments⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/nevermined-payments/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: nevermined-payments description: > Integrates Nevermined payment infrastructure into AI agents, MCP servers, Google A2A agents, and REST APIs. Handles x402 protocol, credit billing, payment plans, and SDK integration for TypeScript (@nevermined-io/payments) and Python (payments-py). ---
Nevermined provides financial rails for AI agents — real-time monetization, access control, and payments. This skill gives you everything needed to:
The x402 protocol uses HTTP 402 responses to advertise payment requirements. Clients acquire an access token and retry the request. The server verifies permissions, executes the workload, then settles (burns credits).
npm install @nevermined-io/payments or pip install payments-py)references/payment-plans.md)| Variable | Required | Description | |---|---|---| | NVM_API_KEY | Yes | Your Nevermined API key (get it at nevermined.app → Settings → API Keys) | | NVM_ENVIRONMENT | Yes | sandbox for testing, live for production | | NVM_PLAN_ID | Yes | The plan ID from registration | | NVM_AGENT_ID | Sometimes | Required for MCP servers and plans with multiple agents | | BUILDER_ADDRESS | For registration | Wallet address to receive payments |
.env Template# Required
NVM_API_KEY=your-api-key-here
NVM_ENVIRONMENT=sandbox
NVM_PLAN_ID=your-plan-id-here
# Required for MCP servers or multi-agent plans
NVM_AGENT_ID=your-agent-id-here
# Required for registration
BUILDER_ADDRESS=0xYourWalletAddress
package.json must include "type": "module" for the @nevermined-io/payments/express subpath import to work.pip install payments-py[fastapi] — the [fastapi] extra is required for the middleware.npm install @nevermined-io/payments
import { Payments } from '@nevermined-io/payments'
const payments = Payments.getInstance({
nvmApiKey: process.env.NVM_API_KEY!,
environment: 'sandbox'
})
pip install payments-py
import os
from payments_py import Payments, PaymentOptions
payments = Payments.get_instance(
PaymentOptions(
nvm_api_key=os.environ["NVM_API_KEY"],
environment="sandbox"
)
)
Every Nevermined payment integration follows this 5-step pattern:
payment-required header (base64-encoded JSON with plan info)payments.x402.getX402AccessToken(planId, agentId)payment-signature header containing the tokenpayment-response headerChoose the integration that matches your stack:
| Framework | Language | Reference | Key Import | |---|---|---|---| | Express.js | TypeScript/JS | references/express-integration.md | paymentMiddleware from @nevermined-io/payments/express | | FastAPI | Python | references/fastapi-integration.md | PaymentMiddleware from payments_py.x402.fastapi | | Strands Agent | Python | references/strands-integration.md | @requires_payment from payments_py.x402.strands | | MCP Server | TypeScript | references/mcp-paywall.md | payments.mcp.start() / payments.mcp.registerTool() | | Google A2A | TS / Python | references/a2a-integration.md | payments.a2a.start() / payments.a2a.buildPaymentAgentCard() | | Any HTTP | Any | references/x402-protocol.md | Manual verify/settle via facilitator API | | Client-side | TS / Python | references/client-integration.md | payments.x402.getX402AccessToken() |
@nevermined-io/payments)// Initialize
const payments = Payments.getInstance({ nvmApiKey, environment })
// Register agent + plan
const { agentId, planId } = await payments.agents.registerAgentAndPlan(
agentMetadata, agentApi, planMetadata, priceConfig, creditsConfig
)
// Subscriber: order plan and get token
await payments.plans.orderPlan(planId)
const balance = await payments.plans.getPlanBalance(planId)
const { accessToken } = await payments.x402.getX402AccessToken(planId, agentId)
// Server: verify and settle
const verification = await payments.facilitator.verifyPermissions({
paymentRequired, x402AccessToken: token, maxAmount: BigInt(credits)
})
const settlement = await payments.facilitator.settlePermissions({
paymentRequired, x402AccessToken: token, maxAmount: BigInt(creditsUsed)
})
// Helpers
import { buildPaymentRequired } from '@nevermined-io/payments'
import { paymentMiddleware, X402_HEADERS } from '@nevermined-io/payments/express'
// MCP server
payments.mcp.registerTool(name, config, handler, { credits: 5n })
const { info, stop } = await payments.mcp.start({ port, agentId, serverName })
// A2A server
const agentCard = payments.a2a.buildPaymentAgentCard(baseCard, { paymentType, credits, planId, agentId })
const server = await payments.a2a.start({ port, basePath: '/a2a/', agentCard, executor })
// A2A client
const client = payments.a2a.getClient({ agentBaseUrl, agentId, planId })
await client.sendMessage("Hello", accessToken)
payments-py)# Initialize
payments = Payments.get_instance(PaymentOptions(nvm_api_key=key, environment="sandbox"))
# Register agent + plan
result = payments.agents.register_agent_and_plan(
agent_metadata, agent_api, plan_metadata, price_config, credits_config
)
# Subscriber: order plan and get token
payments.plans.order_plan(plan_id)
balance = payments.plans.get_plan_balance(plan_id)
token_res = payments.x402.get_x402_access_token(plan_id, agent_id)
# Server: verify and settle
verification = payments.facilitator.verify_permissions(
payment_required=pr, x402_access_token=token, max_amount=str(credits)
)
settlement = payments.facilitator.settle_permissions(
payment_required=pr, x402_access_token=token, max_amount=str(credits_used)
)
# Helpers
from payments_py.x402.helpers import build_payment_required
from payments_py.x402.fastapi import PaymentMiddleware
from payments_py.x402.strands import requires_payment
# A2A server
from payments_py.a2a.agent_card import build_payment_agent_card
from payments_py.a2a.server import PaymentsA2AServer
agent_card = build_payment_agent_card(base_card, { ... })
server = PaymentsA2AServer.start(agent_card=agent_card, executor=executor, payments_service=payments, port=3005)
# A2A client
client = payments.a2a.get_client(agent_base_url=url, agent_id=agent_id, plan_id=plan_id)
All x402 v2 integrations use these three HTTP headers:
| Header | Direction | Description | |---|---|---| | payment-signature | Client → Server | x402 access token | | payment-required | Server → Client (402) | Base64-encoded JSON with plan requirements | | payment-response | Server → Client (200) | Base64-encoded JSON settlement receipt |
...
安装 Nevermined Payments 后,可以对 AI 说这些话来触发它
Help me get started with Nevermined Payments
Explains what Nevermined Payments does, walks through the setup, and runs a quick demo based on your current project
Use Nevermined Payments to integrates Nevermined payment infrastructure into AI agents, MCP se...
Invokes Nevermined Payments with the right parameters and returns the result directly in the conversation
What can I do with Nevermined Payments in my developer & devops workflow?
Lists the top use cases for Nevermined Payments, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/nevermined-payments/ 目录(个人级,所有项目可用),或 .claude/skills/nevermined-payments/(项目级)。重启 AI 客户端后,用 /nevermined-payments 主动调用,或让 AI 根据上下文自动发现并使用。
Nevermined Payments 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Nevermined Payments 可免费安装使用。请查阅仓库了解许可证信息。
Integrates Nevermined payment infrastructure into AI agents, MCP servers, Google A2A agents, and REST APIs. Handles x402 protocol, credit billing, payment plans, and SDK integration for TypeScript (@nevermined-io/payments) and Python (payments-py).
Nevermined Payments 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Nevermined Payments
Identifies repetitive steps in your workflow and sets up Nevermined Payments to handle them automatically