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

Nevermined API Key

Get your API key from the Nevermined App
3

Test Tokens (Optional)

Some test tokens for testing (you can get some USDC from here)

Installation

npm install @nevermined-io/payments
# or
yarn add @nevermined-io/payments

Getting Your API Key

  1. Go to the Nevermined App
  2. Log in with your credentials (email, Google account, or GitHub)
  3. Navigate to the API Keys section in the left user menu
  4. Click on the New API Key button at the top right of the page
  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 Payments Libraries

import { Payments } from '@nevermined-io/payments'

const payments = Payments.getInstance({
  nvmApiKey: process.env.NVM_API_KEY,
  environment: 'sandbox' // or 'live'
})

Environment Configuration

Choose the appropriate environment for your use case:

Common Issues

If you encounter any issues, check our Frequently Asked Questions or reach out to our community on Discord.