Skip to main content
This guide explains how to import, configure, and initialize the Nevermined Payments Python SDK.

Get the NVM API Key

Before using the SDK, you need a Nevermined API Key:
  1. Go to the Nevermined App
  2. Sign in or create an account
  3. Navigate to Settings > API Keys
  4. Generate a new API key
  5. Copy the key (format: nvm:xxxxxxxx...)
Never commit your API key to version control. Use environment variables or a secrets manager.

Import and Initialize

Basic Initialization

Using Environment Variables

Configuration Options

The PaymentOptions class accepts the following parameters:

API Version Pinning

Every request the SDK sends to the Nevermined backend carries a Nevermined-Version header declaring which backend API version (MAJOR.MINOR) the SDK was built and tested against. You normally don’t need to touch this — the SDK pins the right version for you. To target a different backend contract explicitly:
See the API versioning reference for the list of versions and the changes between them.

Environments

Sandbox Environment (Testing)

Use sandbox for development and testing:
  • Backend: https://api.sandbox.nevermined.app
  • Proxy: https://proxy.sandbox.nevermined.app
  • Uses test tokens and test networks

Live Environment (Production)

Use live for production:
  • Backend: https://api.live.nevermined.app
  • Proxy: https://proxy.live.nevermined.app
  • Uses real tokens and mainnet networks

Custom Environment

For self-hosted or development setups:

Available Environments

Accessing Sub-APIs

The initialized Payments object provides access to specialized APIs:

Error Handling

The SDK raises PaymentsError for API errors:

Next Steps

Now that you have initialized the SDK, proceed to: