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:- 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:--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: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):
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: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):Ordering Plans
Crypto Payment
Purchase a plan with cryptocurrency:Fiat Payment
Initiate a plan purchase with fiat payment. Creates a Stripe PaymentIntent for the plan and returns it; the user completes the payment by confirming it with their card: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:--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 dedicatedplans 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):
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:get-pay-as-you-go-price-config always builds a crypto price, whatever token you pass. For a
card pay-as-you-go plan, use get-fiat-pay-as-you-go-price-config: it is the shorthand that
emits the get-fiat-price-config output with its templateAddress already set to the
PayAsYouGoTemplate address. Equivalently, take the get-fiat-price-config output and set its
templateAddress to the PayAsYouGoTemplate address (the templateAddress that
get-pay-as-you-go-price-config returns). Either way, pair it with
get-pay-as-you-go-credits-config. That template is what makes a plan pay-as-you-go: without it, a
fiat price with the pay-as-you-go credits config registers a one-credit credits plan. A card
pay-as-you-go plan is paid per request through an x402 card delegation and cannot be bought through
checkout. Its per-request price must be at least $1.00 (--amount 1000000, in 6-decimal units),
otherwise registration fails with BCK.PROTOCOL.0047.
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 ofPlanCreditsConfig):