Skip to main content

Installation

The Nevermined Payments Library is a TypeScript SDK that enables AI builders and subscribers to monetize and access AI agents through the Nevermined protocol. The library supports flexible payment plans (credits and time-based), multiple payment methods (crypto and fiat), and seamless integration with AI agent frameworks.

Overview

The Payments Library provides:
  • Registration and discovery of AI agents with payment plans
  • Flexible pricing options (fixed per request or dynamic usage-based)
  • Credit-based access control with on-chain settlement
  • Support for browser and Node.js environments
  • Integration with MCP (Model Context Protocol) and A2A (Agent-to-Agent) protocols

Prerequisites

Before installing the Nevermined Payments Library, ensure you have:
  • Node.js: Version 18.x or higher
  • TypeScript: Version 5.x or higher (recommended)
  • Nevermined API Key: Get your free API key from nevermined.app
  • Package Manager: npm (included with Node.js) or yarn

Installation

Install the library using npm or yarn:
# Using npm
npm install @nevermined-io/payments

# Using yarn
yarn add @nevermined-io/payments

Peer Dependencies

The library has optional peer dependencies for specific integrations:
# For MCP (Model Context Protocol) integration
npm install @modelcontextprotocol/sdk

# For Express-based HTTP agents
npm install express @types/express
These dependencies are only required if you’re using the respective integration features.

Verify Installation

After installation, verify the library is correctly installed by importing it:
import { Payments } from '@nevermined-io/payments'

console.log('Nevermined Payments Library installed successfully!')
You can also check the installed version:
npm list @nevermined-io/payments

Next Steps

After successful installation:
  1. Get your Nevermined API key from nevermined.app
  2. Choose your environment (sandbox for testing, live for production)
  3. Initialize the Payments instance in your application
Continue to Initializing the Library to get started.
Source References:
  • package.json
  • README.md