Skip to main content

Overview

Payment Plans in NVM Pay define the commercial relationship between AI builders and their users. Each plan consists of two core configurations: pricing and credits.

Plan Types

Time-Based Plans (Subscriptions)

Perfect for unlimited access within a time period:
// Monthly subscription for $29.99
const planMetadata = {
  name: 'Pro Monthly',
  description: 'Unlimited access for 30 days'
}

const priceConfig = getFiatPriceConfig(
  29_990_000n, // $29.99 (8 decimals)
  builderAddress
)

const timeConfig = getExpirableDurationConfig(
  86400n * 30n // 30 days in seconds
)

const { planId } = await payments.plans.registerTimePlan(
  planMetadata,
  priceConfig,
  timeConfig
)

Credit-Based Plans (Usage)

Ideal for pay-per-use models:
// 100 credits for 10 USDC
const planMetadata = {
  name: 'Starter Pack',
  description: '100 API calls'
}

const priceConfig = getERC20PriceConfig(
  10_000_000n, // 10 USDC
  USDC_ADDRESS,
  builderAddress
)

const creditsConfig = getFixedCreditsConfig(
  100n, // Total credits
  1n    // Credits per request
)

const { planId } = await payments.plans.registerCreditsPlan(
  planMetadata,
  priceConfig,
  creditsConfig
)

Hybrid Plans

Combine time limits with usage caps:
// 1000 credits valid for 30 days
const hybridConfig = {
  creditsType: 'EXPIRABLE',
  amount: 1000n,
  creditsPerRequest: 1n,
  durationOfThePlan: 86400n * 30n
}

Dynamic Pricing

For variable credit consumption based on request complexity:
const dynamicConfig = {
  creditsType: 'DYNAMIC',
  amount: 1000n,
  minCreditsPerRequest: 1n,   // Minimum per request
  maxCreditsPerRequest: 50n   // Maximum per request
}

Plan Management

Multiple Plans per Agent

Offer different tiers for different user segments:
const plans = []

// Basic tier
const basic = await payments.plans.registerCreditsPlan(
  { name: 'Basic', description: 'For individuals' },
  getFiatPriceConfig(9_990_000n, builderAddress),
  getFixedCreditsConfig(100n, 1n)
)
plans.push(basic.planId)

// Pro tier
const pro = await payments.plans.registerCreditsPlan(
  { name: 'Pro', description: 'For teams' },
  getFiatPriceConfig(49_990_000n, builderAddress),
  getFixedCreditsConfig(1000n, 1n)
)
plans.push(pro.planId)

// Register agent with all plans
const { agentId } = await payments.agents.registerAgent(
  agentMetadata,
  agentApi,
  plans
)

Plan Lifecycle

1

Creation

Define price and credit configurations
2

Association

Link plans to AI agents
3

Discovery

Users browse available plans
4

Purchase

Users buy plans to gain access
5

Usage

Credits consumed as service is used

Configuration Reference

PriceConfig

interface PriceConfig {
  priceType: 'FIXED_PRICE' | 'DYNAMIC_PRICE'
  tokenAddress: string      // ERC-20 token or '0x0' for native
  amounts: bigint[]        // Payment amounts
  receivers: string[]      // Payment recipients
}

CreditsConfig

interface CreditsConfig {
  creditsType: 'FIXED' | 'EXPIRABLE' | 'DYNAMIC'
  amount: bigint                    // Total credits
  creditsPerRequest?: bigint        // Fixed consumption
  minCreditsPerRequest?: bigint     // Dynamic minimum
  maxCreditsPerRequest?: bigint     // Dynamic maximum
  durationOfThePlan?: bigint        // Expiration time
}

Best Practices

  • Research competitor pricing
  • Start with simple models
  • Offer clear value tiers
  • Consider free trials
  • Set reasonable limits
  • Monitor usage patterns
  • Adjust based on costs
  • Provide usage visibility
  • Name plans clearly
  • Write descriptive metadata
  • Group related features
  • Highlight differences