{"id":"7897172f-bcc8-4433-a7bf-fe45bf74d8a0","entityType":"agent","slug":"clawhub-skills-aaitor-nevermined-payments","name":"nevermined-payments","canonicalUrl":"https://www.xpersona.co/agent/clawhub-skills-aaitor-nevermined-payments","canonicalPath":"/agent/clawhub-skills-aaitor-nevermined-payments","generatedAt":"2026-10-10T04:10:43.625Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"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). --- 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 Payments Integration Overview Nevermined provides financial rails for AI agents — real-time monetization, acces","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. Last updated 4/15/2026.","installCommand":"clawhub skill install skills:aaitor:nevermined-payments","sourceUrl":"https://github.com/openclaw/skills/tree/main/skills/aaitor/nevermined-payments","homepage":null,"primaryLinks":[{"label":"View on ClawHub","url":"https://github.com/openclaw/skills/tree/main/skills/aaitor/nevermined-payments","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":50,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Integrates Nevermined payment infrastructure into AI agents, MCP servers, Google A2A agents, and REST APIs. Handles x402 protocol, credit billing, payment plans"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"protocols":[{"protocol":"A2A","label":"A2A","status":"self-declared","notes":"Declared in the public agent profile."},{"protocol":"MCP","label":"MCP","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[{"label":"several","status":"self-declared"}],"verifiedCount":0,"selfDeclaredCount":3,"capabilityMatrix":{"rows":[{"key":"A2A","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"MCP","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"several","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"}],"flattenedTokens":"protocol:A2A|unknown|profile protocol:MCP|unknown|profile capability:several|supported|profile"}},"adoption":{"evidence":{"source":"no-adoption-signals","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"No source adoption metrics were available."},"stars":null,"forks":null,"downloads":null,"packageName":null,"latestVersion":null,"tractionLabel":null},"release":{"evidence":{"source":"agent-index","verified":false,"confidence":"medium","updatedAt":"2026-02-25T05:54:15.603Z","emptyReason":null},"lastUpdatedAt":"2026-04-15T00:45:39.800Z","lastCrawledAt":"2026-02-25T05:54:15.603Z","lastIndexedAt":null,"nextCrawlAt":"2026-02-26T05:54:15.603Z","lastVerifiedAt":null,"highlights":[]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install skills:aaitor:nevermined-payments","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["A2A","MCP"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T04:10:43.624Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-aaitor-nevermined-payments/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"readme":"---\nname: nevermined-payments\ndescription: >\n  Integrates Nevermined payment infrastructure into AI agents, MCP servers,\n  Google A2A agents, and REST APIs. Handles x402 protocol, credit billing,\n  payment plans, and SDK integration for TypeScript (@nevermined-io/payments)\n  and Python (payments-py).\n---\n\n# Nevermined Payments Integration\n\n## Overview\n\nNevermined provides financial rails for AI agents — real-time monetization, access control, and payments. This skill gives you everything needed to:\n\n- Protect API endpoints with the **x402 payment protocol**\n- Charge per-request using **credit-based billing**\n- Integrate with **Express.js**, **FastAPI**, **Strands agents**, **MCP servers**, or **Google A2A agents**\n- Support **subscriber-side** flows (purchase plans, generate tokens, call protected APIs)\n- Enable **agent-to-agent** payments via the Google A2A protocol\n\nThe 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).\n\n## Quick Start Checklist\n\n1. **Get an API key** at [nevermined.app](https://nevermined.app) → Settings → API Keys\n2. **Install the SDK** (`npm install @nevermined-io/payments` or `pip install payments-py`)\n3. **Register your agent and plan** (via the App UI or programmatically — see `references/payment-plans.md`)\n4. **Add payment protection** to your routes/tools (see framework-specific references below)\n5. **Test** — call without token (expect 402), then with token (expect 200)\n\n## Environment Setup\n\n| Variable | Required | Description |\n|---|---|---|\n| `NVM_API_KEY` | Yes | Your Nevermined API key (get it at [nevermined.app](https://nevermined.app) → Settings → API Keys) |\n| `NVM_ENVIRONMENT` | Yes | `sandbox` for testing, `live` for production |\n| `NVM_PLAN_ID` | Yes | The plan ID from registration |\n| `NVM_AGENT_ID` | Sometimes | Required for MCP servers and plans with multiple agents |\n| `BUILDER_ADDRESS` | For registration | Wallet address to receive payments |\n\n### `.env` Template\n\n```bash\n# Required\nNVM_API_KEY=your-api-key-here\nNVM_ENVIRONMENT=sandbox\nNVM_PLAN_ID=your-plan-id-here\n\n# Required for MCP servers or multi-agent plans\nNVM_AGENT_ID=your-agent-id-here\n\n# Required for registration\nBUILDER_ADDRESS=0xYourWalletAddress\n```\n\n### Prerequisites\n\n- **TypeScript/Express.js**: Node.js 18+. Your `package.json` must include `\"type\": \"module\"` for the `@nevermined-io/payments/express` subpath import to work.\n- **Python/FastAPI**: Python 3.9+. Install with `pip install payments-py[fastapi]` — the `[fastapi]` extra is required for the middleware.\n\n### TypeScript\n\n```bash\nnpm install @nevermined-io/payments\n```\n\n```typescript\nimport { Payments } from '@nevermined-io/payments'\n\nconst payments = Payments.getInstance({\n  nvmApiKey: process.env.NVM_API_KEY!,\n  environment: 'sandbox'\n})\n```\n\n### Python\n\n```bash\npip install payments-py\n```\n\n```python\nimport os\nfrom payments_py import Payments, PaymentOptions\n\npayments = Payments.get_instance(\n    PaymentOptions(\n        nvm_api_key=os.environ[\"NVM_API_KEY\"],\n        environment=\"sandbox\"\n    )\n)\n```\n\n## Core Workflow (All Integrations)\n\nEvery Nevermined payment integration follows this 5-step pattern:\n\n1. **Client sends request** without a payment token\n2. **Server returns 402** with `payment-required` header (base64-encoded JSON with plan info)\n3. **Client acquires x402 token** via `payments.x402.getX402AccessToken(planId, agentId)`\n4. **Client retries** with `payment-signature` header containing the token\n5. **Server verifies → executes → settles** (burns credits), returns response with `payment-response` header\n\n## Framework Decision Tree\n\nChoose the integration that matches your stack:\n\n| Framework | Language | Reference | Key Import |\n|---|---|---|---|\n| **Express.js** | TypeScript/JS | `references/express-integration.md` | `paymentMiddleware` from `@nevermined-io/payments/express` |\n| **FastAPI** | Python | `references/fastapi-integration.md` | `PaymentMiddleware` from `payments_py.x402.fastapi` |\n| **Strands Agent** | Python | `references/strands-integration.md` | `@requires_payment` from `payments_py.x402.strands` |\n| **MCP Server** | TypeScript | `references/mcp-paywall.md` | `payments.mcp.start()` / `payments.mcp.registerTool()` |\n| **Google A2A** | TS / Python | `references/a2a-integration.md` | `payments.a2a.start()` / `payments.a2a.buildPaymentAgentCard()` |\n| **Any HTTP** | Any | `references/x402-protocol.md` | Manual verify/settle via facilitator API |\n| **Client-side** | TS / Python | `references/client-integration.md` | `payments.x402.getX402AccessToken()` |\n\n## SDK Quick Reference\n\n### TypeScript (`@nevermined-io/payments`)\n\n```typescript\n// Initialize\nconst payments = Payments.getInstance({ nvmApiKey, environment })\n\n// Register agent + plan\nconst { agentId, planId } = await payments.agents.registerAgentAndPlan(\n  agentMetadata, agentApi, planMetadata, priceConfig, creditsConfig\n)\n\n// Subscriber: order plan and get token\nawait payments.plans.orderPlan(planId)\nconst balance = await payments.plans.getPlanBalance(planId)\nconst { accessToken } = await payments.x402.getX402AccessToken(planId, agentId)\n\n// Server: verify and settle\nconst verification = await payments.facilitator.verifyPermissions({\n  paymentRequired, x402AccessToken: token, maxAmount: BigInt(credits)\n})\nconst settlement = await payments.facilitator.settlePermissions({\n  paymentRequired, x402AccessToken: token, maxAmount: BigInt(creditsUsed)\n})\n\n// Helpers\nimport { buildPaymentRequired } from '@nevermined-io/payments'\nimport { paymentMiddleware, X402_HEADERS } from '@nevermined-io/payments/express'\n\n// MCP server\npayments.mcp.registerTool(name, config, handler, { credits: 5n })\nconst { info, stop } = await payments.mcp.start({ port, agentId, serverName })\n\n// A2A server\nconst agentCard = payments.a2a.buildPaymentAgentCard(baseCard, { paymentType, credits, planId, agentId })\nconst server = await payments.a2a.start({ port, basePath: '/a2a/', agentCard, executor })\n// A2A client\nconst client = payments.a2a.getClient({ agentBaseUrl, agentId, planId })\nawait client.sendMessage(\"Hello\", accessToken)\n```\n\n### Python (`payments-py`)\n\n```python\n# Initialize\npayments = Payments.get_instance(PaymentOptions(nvm_api_key=key, environment=\"sandbox\"))\n\n# Register agent + plan\nresult = payments.agents.register_agent_and_plan(\n    agent_metadata, agent_api, plan_metadata, price_config, credits_config\n)\n\n# Subscriber: order plan and get token\npayments.plans.order_plan(plan_id)\nbalance = payments.plans.get_plan_balance(plan_id)\ntoken_res = payments.x402.get_x402_access_token(plan_id, agent_id)\n\n# Server: verify and settle\nverification = payments.facilitator.verify_permissions(\n    payment_required=pr, x402_access_token=token, max_amount=str(credits)\n)\nsettlement = payments.facilitator.settle_permissions(\n    payment_required=pr, x402_access_token=token, max_amount=str(credits_used)\n)\n\n# Helpers\nfrom payments_py.x402.helpers import build_payment_required\nfrom payments_py.x402.fastapi import PaymentMiddleware\nfrom payments_py.x402.strands import requires_payment\n\n# A2A server\nfrom payments_py.a2a.agent_card import build_payment_agent_card\nfrom payments_py.a2a.server import PaymentsA2AServer\nagent_card = build_payment_agent_card(base_card, { ... })\nserver = PaymentsA2AServer.start(agent_card=agent_card, executor=executor, payments_service=payments, port=3005)\n# A2A client\nclient = payments.a2a.get_client(agent_base_url=url, agent_id=agent_id, plan_id=plan_id)\n```\n\n## x402 Payment Headers\n\nAll x402 v2 integrations use these three HTTP headers:\n\n| Header | Direction | Description |\n|---|---|---|\n| `payment-signature` | Client → Server | x402 access token |\n| `payment-required` | Server → Client (402) | Base64-encoded JSON with plan requirements |\n| `payment-response` | Server → Client (200) | Base64-encoded JSON settlement receipt |\n\nThe `payment-required` payload structure:\n```json\n{\n  \"x402Version\": 2,\n  \"accepts\": [{\n    \"scheme\": \"nvm:erc4337\",\n    \"network\": \"eip155:84532\",\n    \"planId\": \"<plan-id>\",\n    \"extra\": { \"agentId\": \"<agent-id>\" }\n  }]\n}\n```\n\n## Payment Plan Types\n\nNevermined supports several plan types:\n\n- **Credits-based**: prepaid balance, deducted per request (most common for APIs)\n- **Time-based**: access for a fixed duration (e.g., 30 days unlimited)\n- **Pay-as-you-go (PAYG)**: settle in USDC per request, no credit balance\n- **Trial**: free limited access, one-time claim per user\n- **Hybrid**: combine credits with time expiry\n\nSee `references/payment-plans.md` for plan registration code.\n\n## Common Patterns\n\n### Express.js — Fixed credits per route\n\n```typescript\nimport { paymentMiddleware } from '@nevermined-io/payments/express'\n\napp.use(paymentMiddleware(payments, {\n  'POST /ask': { planId: PLAN_ID, credits: 1 },\n  'POST /generate': { planId: PLAN_ID, credits: 5 }\n}))\n```\n\n### FastAPI — Fixed credits per route\n\n```python\nfrom payments_py.x402.fastapi import PaymentMiddleware\n\napp.add_middleware(\n    PaymentMiddleware,\n    payments=payments,\n    routes={\n        \"POST /ask\": {\"plan_id\": PLAN_ID, \"credits\": 1},\n        \"POST /generate\": {\"plan_id\": PLAN_ID, \"credits\": 5}\n    }\n)\n```\n\n### Express.js — Dynamic credits based on response\n\n```typescript\npaymentMiddleware(payments, {\n  'POST /generate': {\n    planId: PLAN_ID,\n    credits: (req, res) => {\n      const tokens = res.locals.tokenCount || 100\n      return Math.ceil(tokens / 100)\n    }\n  }\n})\n```\n\n### FastAPI — Dynamic credits based on request\n\n```python\nasync def calculate_credits(request: Request) -> int:\n    body = await request.json()\n    max_tokens = body.get(\"max_tokens\", 100)\n    return max(1, max_tokens // 100)\n\napp.add_middleware(\n    PaymentMiddleware,\n    payments=payments,\n    routes={\"POST /generate\": {\"plan_id\": PLAN_ID, \"credits\": calculate_credits}}\n)\n```\n\n### MCP Server — Register tool with paywall\n\n```typescript\npayments.mcp.registerTool(\n  \"weather.today\",\n  { title: \"Today's Weather\", inputSchema: z.object({ city: z.string() }) },\n  async (args, extra, context) => ({\n    content: [{ type: \"text\", text: `Weather in ${args.city}: Sunny, 25C` }]\n  }),\n  { credits: 5n }\n)\n\nconst { info, stop } = await payments.mcp.start({\n  port: 3000,\n  agentId: process.env.NVM_AGENT_ID!,\n  serverName: \"my-server\"\n})\n```\n\n### Strands Agent — Decorator-based payment\n\n```python\nfrom strands import Agent, tool\nfrom payments_py.x402.strands import requires_payment\n\n@tool(context=True)\n@requires_payment(payments=payments, plan_id=PLAN_ID, credits=1)\ndef analyze_data(query: str, tool_context=None) -> dict:\n    return {\"status\": \"success\", \"content\": [{\"text\": f\"Analysis: {query}\"}]}\n\nagent = Agent(tools=[analyze_data])\n```\n\n### Google A2A — Agent server with payment extension\n\n#### TypeScript\n\n```typescript\nconst agentCard = payments.a2a.buildPaymentAgentCard(baseAgentCard, {\n  paymentType: \"dynamic\",\n  credits: 1,\n  planId: process.env.NVM_PLAN_ID!,\n  agentId: process.env.NVM_AGENT_ID!,\n})\n\nconst server = await payments.a2a.start({\n  port: 3005,\n  basePath: '/a2a/',\n  agentCard,\n  executor: new MyExecutor(),\n})\n```\n\n#### Python\n\n```python\nfrom payments_py.a2a.agent_card import build_payment_agent_card\nfrom payments_py.a2a.server import PaymentsA2AServer\n\nagent_card = build_payment_agent_card(base_agent_card, {\n    \"paymentType\": \"dynamic\",\n    \"credits\": 1,\n    \"planId\": os.environ[\"NVM_PLAN_ID\"],\n    \"agentId\": os.environ[\"NVM_AGENT_ID\"],\n})\n\nserver = PaymentsA2AServer.start(\n    agent_card=agent_card,\n    executor=MyExecutor(),\n    payments_service=payments,\n    port=3005,\n    base_path=\"/a2a/\",\n)\n```\n\n### Google A2A — Client sending a paid task\n\n```typescript\nconst client = payments.a2a.getClient({\n  agentBaseUrl: 'http://localhost:3005/a2a/',\n  agentId: AGENT_ID,\n  planId: PLAN_ID,\n})\n\nconst { accessToken } = await payments.x402.getX402AccessToken(PLAN_ID, AGENT_ID)\nconst response = await client.sendMessage(\"Analyze this data\", accessToken)\n```\n\n## Gathering Developer Information Upfront\n\nWhen a developer asks you to integrate Nevermined payments, gather ALL required information in a single question before generating code. This avoids multiple back-and-forth interactions.\n\n**Ask the developer once for:**\n\n1. **Framework**: Express.js, FastAPI, MCP server, Strands agent, Google A2A, or generic HTTP?\n2. **Routes to protect**: Which endpoints need payment protection and how many credits each? (e.g., `POST /chat = 1 credit, POST /generate = 5 credits`)\n3. **Pricing model**: Fixed credits per request, or dynamic pricing based on request/response parameters?\n4. **Nevermined API Key**: Do they already have an `NVM_API_KEY`? If not, direct them to [nevermined.app](https://nevermined.app) → Settings → API Keys\n5. **Plan ID**: Do they already have a `NVM_PLAN_ID`? If not, do they need a registration script too?\n6. **Environment**: `sandbox` (testing) or `live` (production)?\n\n**If they need plan registration, also ask:**\n\n7. **Plan name and description**: e.g., \"Starter Plan — 100 API requests\"\n8. **Pricing**: How much in USDC? (e.g., 10 USDC for 100 credits)\n9. **Credits per plan**: Total credits included (e.g., 100)\n10. **Builder wallet address** (`BUILDER_ADDRESS`): The wallet that receives payments\n\n**Example combined prompt to offer the developer:**\n\n> I need to set up Nevermined payments. Here's my info:\n> - Framework: Express.js\n> - Routes: POST /chat (1 credit), POST /summarize (3 credits)\n> - I need a registration script too\n> - Plan: \"Starter Plan\", 100 credits for 10 USDC\n> - Environment: sandbox\n> - My API key is in the NVM_API_KEY env var\n> - My wallet: 0x1234...\n\nWith this information, generate both the registration script and the payment-protected server in a single response.\n\n## Agent and Plan Registration\n\n### Using the SDK (Recommended)\n\nRegister your agent and plan programmatically — see `references/payment-plans.md` for complete code.\n\n```typescript\n// TypeScript\nconst { agentId, planId } = await payments.agents.registerAgentAndPlan(\n  { name: 'My Agent', description: 'AI service', tags: ['ai'], dateCreated: new Date() },\n  { endpoints: [{ POST: 'https://your-api.com/query' }] },\n  { name: 'Starter Plan', description: '100 requests for $10', dateCreated: new Date() },\n  payments.plans.getERC20PriceConfig(10_000_000n, USDC_ADDRESS, process.env.BUILDER_ADDRESS!),\n  payments.plans.getFixedCreditsConfig(100n, 1n)\n)\n```\n\n```python\n# Python\nresult = payments.agents.register_agent_and_plan(\n    agent_metadata={'name': 'My Agent', 'description': 'AI service', 'tags': ['ai']},\n    agent_api={'endpoints': [{'POST': 'https://your-api.com/query'}]},\n    plan_metadata={'name': 'Starter Plan', 'description': '100 requests for $10'},\n    price_config=get_erc20_price_config(10_000_000, USDC_ADDRESS, os.environ['BUILDER_ADDRESS']),\n    credits_config=get_fixed_credits_config(100, 1)\n)\n```\n\n### Using the Nevermined App (No-Code)\n\n1. Go to [nevermined.app](https://nevermined.app) and sign in\n2. Click \"My agents\" → register a new agent with metadata and endpoints\n3. Create a payment plan: set pricing, credits, and duration\n4. Link the plan to your agent and publish\n5. Copy the `agentId` and `planId` for your `.env` file\n\n### Using the CLI\n\n```bash\n# 1. Install CLI\nnpm install -g @nevermined-io/cli\n\n# 2. Configure (use sandbox for testing)\nnvm config init --api-key \"$NVM_API_KEY\" --environment sandbox\n\n# 3. Register agent and plan together\nnvm agents register-agent-and-plan \\\n  --agent-metadata '{\"name\":\"My Agent\",\"description\":\"AI service\"}' \\\n  --agent-api '{\"endpoints\":[{\"POST\":\"https://your-api.com/query\"}]}' \\\n  --plan-metadata '{\"name\":\"Starter Plan\",\"description\":\"100 requests\"}' \\\n  --price-config '{\"tokenAddress\":\"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\"price\":10000000,\"amountOfCredits\":100}' \\\n  --credits-config '{\"minCreditsRequired\":1,\"minCreditsToCharge\":1,\"maxCreditsToCharge\":10}'\n\n# 4. List your plans\nnvm plans get-plans\n\n# 5. As a subscriber: order a plan and get an x402 token\nnvm plans order-plan $PLAN_ID\nnvm x402token get-x402-access-token $PLAN_ID --agent-id $AGENT_ID\n\n# 6. Test against your running server\ncurl -X POST http://localhost:3000/chat \\\n  -H \"Content-Type: application/json\" \\\n  -H \"payment-signature: $TOKEN\" \\\n  -d '{\"message\": \"Hello\"}'\n```\n\n## Troubleshooting\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| HTTP 402 returned | No `payment-signature` header or invalid/expired token | Generate a fresh token via `getX402AccessToken` |\n| MCP error `-32003` | Payment Required — no token, invalid token, or insufficient credits | Check subscriber has purchased plan and has credits remaining |\n| MCP error `-32002` | Server misconfiguration | Verify `NVM_API_KEY`, `NVM_PLAN_ID`, and `NVM_AGENT_ID` are set correctly |\n| `verification.isValid` is false | Token expired, wrong plan, or insufficient credits | Re-order the plan or generate a new token |\n| Credits not deducting | Settlement not called after request | Ensure you call `settlePermissions` after processing (middleware does this automatically) |\n| `payment-required` header missing | Server not returning 402 properly | Use `buildPaymentRequired()` helper or framework middleware |\n\n## Additional Resources\n\n- **Documentation**: [nevermined.ai/docs](https://nevermined.ai/docs)\n- **Nevermined App**: [nevermined.app](https://nevermined.app) — register agents, create plans, manage subscriptions\n- **MCP Search Server**: `https://docs.nevermined.app/mcp` — search Nevermined docs from any MCP client\n- **Tutorials**: [github.com/nevermined-io/tutorials](https://github.com/nevermined-io/tutorials)\n- **Discord**: [discord.com/invite/GZju2qScKq](https://discord.com/invite/GZju2qScKq)\n- **TypeScript SDK**: `@nevermined-io/payments` on npm\n- **Python SDK**: `payments-py` on PyPI\n","readmeExcerpt":"--- 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 Payments Integration Overview Nevermined provides financial rails for AI agents — real-time monetization, acces","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# Required\nNVM_API_KEY=your-api-key-here\nNVM_ENVIRONMENT=sandbox\nNVM_PLAN_ID=your-plan-id-here\n\n# Required for MCP servers or multi-agent plans\nNVM_AGENT_ID=your-agent-id-here\n\n# Required for registration\nBUILDER_ADDRESS=0xYourWalletAddress"},{"language":"bash","snippet":"npm install @nevermined-io/payments"},{"language":"typescript","snippet":"import { Payments } from '@nevermined-io/payments'\n\nconst payments = Payments.getInstance({\n  nvmApiKey: process.env.NVM_API_KEY!,\n  environment: 'sandbox'\n})"},{"language":"bash","snippet":"pip install payments-py"},{"language":"python","snippet":"import os\nfrom payments_py import Payments, PaymentOptions\n\npayments = Payments.get_instance(\n    PaymentOptions(\n        nvm_api_key=os.environ[\"NVM_API_KEY\"],\n        environment=\"sandbox\"\n    )\n)"},{"language":"typescript","snippet":"// Initialize\nconst payments = Payments.getInstance({ nvmApiKey, environment })\n\n// Register agent + plan\nconst { agentId, planId } = await payments.agents.registerAgentAndPlan(\n  agentMetadata, agentApi, planMetadata, priceConfig, creditsConfig\n)\n\n// Subscriber: order plan and get token\nawait payments.plans.orderPlan(planId)\nconst balance = await payments.plans.getPlanBalance(planId)\nconst { accessToken } = await payments.x402.getX402AccessToken(planId, agentId)\n\n// Server: verify and settle\nconst verification = await payments.facilitator.verifyPermissions({\n  paymentRequired, x402AccessToken: token, maxAmount: BigInt(credits)\n})\nconst settlement = await payments.facilitator.settlePermissions({\n  paymentRequired, x402AccessToken: token, maxAmount: BigInt(creditsUsed)\n})\n\n// Helpers\nimport { buildPaymentRequired } from '@nevermined-io/payments'\nimport { paymentMiddleware, X402_HEADERS } from '@nevermined-io/payments/express'\n\n// MCP server\npayments.mcp.registerTool(name, config, handler, { credits: 5n })\nconst { info, stop } = await payments.mcp.start({ port, agentId, serverName })\n\n// A2A server\nconst agentCard = payments.a2a.buildPaymentAgentCard(baseCard, { paymentType, credits, planId, agentId })\nconst server = await payments.a2a.start({ port, basePath: '/a2a/', agentCard, executor })\n// A2A client\nconst client = payments.a2a.getClient({ agentBaseUrl, agentId, planId })\nawait client.sendMessage(\"Hello\", accessToken)"}],"parameters":{},"dependencies":[],"permissions":[],"extractedFiles":[],"languages":["typescript"],"docsSourceLabel":"CLAWHUB","editorialOverview":"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). --- 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 Payments Integration Overview Nevermined provides financial rails for AI agents — real-time monetization, acces","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":389,"uniquenessScore":62,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:10:43.625Z","emptyReason":null},"items":[{"id":"01b44828-9051-4784-b53d-a3bfdc26129e","entityType":"agent","canonicalPath":"/agent/clawhub-skills-402goose-compact-state","slug":"clawhub-skills-402goose-compact-state","name":"compact-state","description":"Join The Compact State — a shared autonomous agent network with on-chain identity, persistent memory, and collective governance.","url":"https://github.com/openclaw/skills/tree/main/skills/402goose/compact-state","homepage":null,"source":"CLAWHUB","protocols":["A2A"],"capabilities":["discover","contribute"],"safetyScore":80,"overallRank":62,"updatedAt":"2026-04-15T00:45:39.800Z","createdAt":"2026-02-25T03:27:49.517Z","downloads":null},{"id":"35eaa8ba-04d8-49f5-83c1-b3187f746974","entityType":"agent","canonicalPath":"/agent/clawhub-skills-andrewandrewsen-yellowagents","slug":"clawhub-skills-andrewandrewsen-yellowagents","name":"yellowagents","description":"Yellow Pages for AI agents — discover, register, and search for agents by skill, language, location, and cost model via the yellowagents.top API.","url":"https://github.com/openclaw/skills/tree/main/skills/andrewandrewsen/yellowagents","homepage":"https://yellowagents.top","source":"CLAWHUB","protocols":["A2A"],"capabilities":["find","retrieve"],"safetyScore":80,"overallRank":62,"updatedAt":"2026-04-15T00:45:39.800Z","createdAt":"2026-02-25T03:36:33.171Z","downloads":null},{"id":"f9a8ab47-0b5b-4201-90e2-22b75bcf941e","entityType":"agent","canonicalPath":"/agent/clawhub-skills-andrewandrewsen-a2achat","slug":"clawhub-skills-andrewandrewsen-a2achat","name":"a2achat","description":"Secure agent-to-agent messaging — handshake, send, poll, and stream messages between AI agents via the a2achat.top API.","url":"https://github.com/openclaw/skills/tree/main/skills/andrewandrewsen/a2achat","homepage":"https://a2achat.top","source":"CLAWHUB","protocols":["A2A","OPENCLAW"],"capabilities":["retrieve","request","reach"],"safetyScore":80,"overallRank":62,"updatedAt":"2026-04-15T00:45:39.800Z","createdAt":"2026-02-25T03:36:31.874Z","downloads":null},{"id":"5e346f1b-c7e5-4301-a80e-95897693db80","entityType":"agent","canonicalPath":"/agent/clawhub-skills-alex-tradequo-moltflow-whatsapp","slug":"clawhub-skills-alex-tradequo-moltflow-whatsapp","name":"WhatsApp Ultimate — No Meta API | Lead Mining, Bulk Send, Scheduled Reminders & Follow-ups","description":"Documentation-only WhatsApp API reference — zero executables, zero install scripts, zero local file writes. All actions require explicit user invocation. Provides 90+ API endpoints for sending messages, capturing leads, running campaigns, scheduling reports, tracking campaign analytics, and managing clients. MOLTFLOW_API_KEY is the only credential required — generate a scoped key from the MoltFlow dashboard (Settings > API Keys). AI features (voice transcription, RAG, style profiles) use the user's own LLM API key configured via the MoltFlow web dashboard, never passed through this skill.","url":"https://github.com/openclaw/skills/tree/main/skills/alex-tradequo/moltflow-whatsapp","homepage":"https://molt.waiflow.app","source":"CLAWHUB","protocols":["A2A","MCP","OPENCLAW"],"capabilities":["to","help","send","questions"],"safetyScore":80,"overallRank":62,"updatedAt":"2026-04-15T00:45:39.800Z","createdAt":"2026-02-25T03:33:17.733Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"A2A","href":"/agent/protocol/a2a"},{"label":"MCP","href":"/agent/protocol/mcp"}]}}}