Nevermined Payments Python SDK¶
The Nevermined Payments Python SDK provides a complete solution for integrating AI agent monetization and access control into your applications.
Features¶
- Payment Plans: Create and manage credits-based and time-based payment plans
- AI Agents: Register and monetize AI agents with flexible pricing models
- X402 Protocol: Industry-standard payment verification and settlement
- MCP Integration: Build monetized MCP (Model Context Protocol) servers
- A2A Protocol: Agent-to-Agent communication with payment support
Quick Start¶
from payments_py import Payments, PaymentOptions
# Initialize the SDK
payments = Payments.get_instance(
PaymentOptions(
nvm_api_key="your-nvm-api-key",
environment="sandbox"
)
)
# Create a payment plan
from payments_py.common.types import PlanMetadata
from payments_py.plans import get_erc20_price_config, get_fixed_credits_config
plan_metadata = PlanMetadata(name="Basic Plan", description="100 credits plan")
price_config = get_erc20_price_config(20, ERC20_TOKEN_ADDRESS, builder_address)
credits_config = get_fixed_credits_config(100)
result = payments.plans.register_credits_plan(plan_metadata, price_config, credits_config)
print(f"Plan created: {result['planId']}")
Documentation Structure¶
API Reference¶
Step-by-step guides for using the SDK:
- Installation - How to install the library
- Initializing the Library - Configuration and setup
- Payment Plans - Create and manage payment plans
- Agents - Register and manage AI agents
- Publishing Static Resources - Publish files and datasets
- Payments and Balance - Order plans and check balances
- Querying an Agent - Get access tokens and make requests
- Request Validation - Validate incoming requests
- MCP Integration - Build MCP servers with payments
- A2A Integration - Agent-to-Agent protocol integration
- x402 Protocol - Payment permissions and settlement
Reference¶
Detailed API documentation:
- Payments Class - Main SDK class reference
- Data Models - Type definitions and models
- Environments - Environment configuration