Skip to main content

Managing Payment Plans

Complete guide to creating and managing payment plans with the Nevermined CLI.

Overview

Payment plans define how users can access your AI agents and services. Plans can be:
  • Credits-based: Pay per API call or credit consumed
  • Time-based: Subscription access for a duration
  • Trial plans: One-time-use plans for testing (credits or time limited)

Listing Plans

View all available payment plans:

Getting Plan Details

Retrieve detailed information about a specific plan:
Example:
Output includes:
  • Plan metadata (name, description, creator)
  • Pricing configuration
  • Credits configuration
  • Payment token information

Checking Plan Balance

Check your credit balance for a plan:

Getting Agents for a Plan

List all agents accessible through a specific plan:

Creating Plans

Flexible Plan Registration

Register a plan with full control over price and credits/duration configuration:
Optional flags:
  • --nonce — Custom nonce value
  • --access-limit — Maximum number of times the plan can be ordered

Credits Plan

Create a pay-per-use plan with credits:
plan-metadata.json:
price-config.json (PlanPriceConfig) — charge a fixed crypto price; amounts is in the token’s smallest unit (e.g. 1000000 = 1 USDC at 6 decimals) and receivers collects it (this is what nevermined plans get-erc20-price-config / get-native-token-price-config emit):
credits-config.json (PlanCreditsConfig) — grant 100 credits, burn 1 per request (what nevermined plans get-fixed-credits-config emits):

Time-Based Plan

Create a subscription plan with time-limited access:
credits-config.json (for time plan) (PlanCreditsConfig) — a time-limited plan sets durationSecs > 0 (what nevermined plans get-expirable-duration-config emits):
durationSecs is in seconds (2592000 = 30 days).

Trial Plans

Trial plans can only be purchased once per user and are useful for letting users test your agents. Credits trial (limited by credits):
Time trial (limited by duration):

Ordering Plans

Crypto Payment

Purchase a plan with cryptocurrency:

Fiat Payment

Initiate a plan purchase with fiat payment. Returns a URL where the user can complete the payment:

Minting Credits

Mint Credits

Add credits to a plan and transfer them to a receiver (plan owner only):

Mint Expirable Credits

Add time-limited credits:
The --credits-duration flag is optional and specifies duration in seconds.

Redeeming Credits

Credit redemption (burning credits after a paid request) is performed via the x402 facilitator, not via a dedicated plans command. The legacy nevermined plans redeem-credits command was removed because the backend exposes no direct redeem endpoint — the only burn path is POST /api/v1/x402/settle. Migration (subscriber side — get an access token):
Migration (agent side — verify and settle):
settle-permissions is idempotent on agentRequestId — replaying the same id returns the same transaction id without double-burning.

Price Configuration Helpers

The CLI provides helper commands to build price configuration objects:

Credits Configuration Helpers

Helper commands to build credits configuration objects:

Advanced Operations

Set Onchain Mirror

Mark whether burns of these credits are mirrored on-chain:

Set Redemption Type

Set the redemption type in a credits configuration:

JSON Output for Scripting

Use --format json for machine-readable output:

Examples

Example 1: Create a Basic AI Agent Plan

Example 2: Monitor Plan Balance

Best Practices

1. Use Descriptive Metadata

Make your plans discoverable with clear names and descriptions:

2. Set Appropriate Credit Limits

Configure the min/max credits burned per request to prevent abuse (fields of PlanCreditsConfig):

3. Test in Sandbox First

Always test new plans in sandbox before going live:

Common Issues

”Insufficient balance”

When registering plans, ensure you have enough credits or tokens in your account.

”Plan not found”

Ensure you’re using the correct environment and plan ID:

Next Steps

  • Agents - Register agents with your plans
  • Purchases - Order plans and make payments
  • Querying - Query agents with access tokens