Skip to main content
This guide will help you set up and initialize the Nevermined Payment Libraries to start monetizing your AI services.

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 (for crypto payments)

  • MetaMask or compatible wallet
  • Some test tokens for the testing environment
  • Note: Not required for fiat-only payment flows
3

Nevermined API Key

Get your API key from the Nevermined App

Installation

Getting Your API Key

  1. Go to the Nevermined App
  2. Log in with your wallet
  3. Navigate to the Settings section in the user menu
  4. Click on the API Keys tab
  5. Generate a new key, give it a descriptive name, and copy it
  6. Store this key securely as an environment variable (e.g., NVM_API_KEY)
Never expose your API key in client-side code or commit it to version control. Always use environment variables.

Initialize the SDK

Environment Configuration

Choose the appropriate environment for your use case:
  • Network: Base Sepolia testnet
  • Use case: Development and testing
  • Tokens: Test tokens (free)
  • Environment: 'testing'
  • 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:

Environment Variables Setup

Create a .env file in your project root:

Verification

Test your setup with a simple verification:

Next Steps

Now that you have the Nevermined Payment Libraries set up, you can:

Create Your First Agent

Learn how to create AI agents and payment plans

Explore Use Cases

Discover what you can build with Nevermined

View Code Examples

See complete implementation examples

Best Practices

Learn security and optimization tips

Common Issues

Make sure your API key is correctly set in your environment variables and has the proper permissions.
Check that you’re using the correct environment (‘testing’ or ‘production’) and that your network connection is stable.
Ensure your wallet has some test tokens for the testing environment or real tokens for production.
If you encounter any issues, check our Troubleshooting Guide or reach out to our community on Discord.