The Nevermined Payment Libraries
The Nevermined Payment Libraries are software components that enable programmatic interaction with the Nevermined ecosystem. Payment Libraries allow AI Builders and developers to monetize their AI Applications (such as AI Agents or Services) and integrate them seamlessly. The Payment Libraries are designed for two main scenarios:- Human to Agent: The libraries can be used in browser or CLI environments, allowing human users to interact with AI Agents. They support registering and listing AI Agents, purchasing access, and querying agents as subscribers.
- Agent to Agent: The libraries can be embedded within AI Agents, enabling them to interact with other AI Agents, purchase access to APIs, and query them programmatically.
The TypeScript implementation can be used for building AI Agents and also for building Web applications like AI Marketplaces.
Main Features
- Register AI Agents
- Create Pricing Plans defining the conditions (price & usage) for subscribers
- Associate Pricing Plans to AI Agents, so when a subscriber purchases a payment plan they can query all the agents associated to it
- Order Pricing Plans (payments in Fiat & Crypto) giving access to the AI Agents
- Query AI Agents programmatically
- Build AI Agents able to process tasks sent by users
- Easy integration with Agent orchestration frameworks like Google A2A and MCP
Prerequisites
Before you begin, make sure you have:1
Development Environment
- Node.js 16+ and npm/yarn (for TypeScript)
- Python 3.8+ (for Python)
- A code editor (VS Code recommended)
2
Blockchain Wallet
- MetaMask or compatible wallet
- Some test tokens for the testing environment
3
Nevermined API Key
Get your API key from the Nevermined App
Installation
- TypeScript/JavaScript
- Python
Getting Your API Key
- Go to the Nevermined App
- Log in with your wallet
- Navigate to the Settings section in the user menu
- Click on the API Keys tab
- Generate a new key, give it a descriptive name, and copy it
- Store this key securely as an environment variable (e.g.,
NVM_API_KEY)
Initialize the SDK
- TypeScript
- Python
Environment Configuration
Choose the appropriate environment for your use case:Testing Environment
Testing Environment
- Network: Base Sepolia testnet
- Use case: Development and testing
- Tokens: Test tokens (free)
- Environment:
'testing'
Production Environment
Production Environment
- Network: Base Mainnet
- Use case: Live applications
- Tokens: Real tokens (paid)
- Environment:
'production'
Basic Configuration Example
Here’s a complete example of setting up the Payments client:- TypeScript
- Python
Environment Variables Setup
Create a.env file in your project root:
Verification
Test your setup with a simple verification:- TypeScript
- Python
Common Issues
Invalid API Key Error
Invalid API Key Error
Make sure your API key is correctly set in your environment variables and has the proper permissions.
Network Connection Issues
Network Connection Issues
Check that you’re using the correct environment (‘testing’ or ‘production’) and that your network connection is stable.
Wallet Connection Problems
Wallet Connection Problems
Ensure your wallet has some test tokens for the testing environment or real tokens for production.
Need Help?
If you have questions about Nevermined Payment Libraries, you’re always welcome to ask our community on Discord or Twitter. If you encounter any issues, check our Troubleshooting Guide or reach out to our community.Next Steps
Now that you have the Nevermined Payment Libraries set up, explore the integration workflow:Payment Library Capabilities
Discover what you can build with Nevermined Payment Libraries
Register Plans & Agents
Learn how to register payment plans and AI agents
Purchase Plans
How users can purchase payment plans
Query Agents
How to query AI agents after purchasing access
Handle Requests
How AI agents can accept and validate paid requests
View Examples
See complete implementation examples