Nevermined App
Go to the Nevermined App and click on “My agents” or “My pricing plans” to crete Payment Plans and register your AI Agents.
Payments Libraries
Use the Payments Libraries to programmatically create Payment Plans and register AI Agents.
In this guide, we will focus on how to register AI Agents and create Payment Plans using the Payments Libraries.
Creating a Payment Plan
Payment Plans give AI Builders the ability to control how and when users can use an AI Agent or service. They are entirely controlled and managed by the AI Builder that creates them with no interference from Nevermined. Nevermined Payment Plans enable time-based or request-based gating of an AI Agent.Creating Credit-Based Plans
Provides user access with per-request pricing. Builders can manage the cost per request to access their AI service. This is done by setting the price to purchase a bundle of credits and the number of credits redeemed for each request (call onfigured during Plan creation). Each time a request is made, user credits are validated and redeemed. If the user does not have enough credits, they will be prompted to purchase more and denied access until they do so.- TypeScript
- Python
Creating a Time-Based Plan
Provides user access on a time-gating basis. Builders can set the time period that a user is allowed access to the AI (e.g. 1 year, 1 month, 1 hour, etc.). When a user makes their first request, the corresponding access credit is redeemed, granting access for the designated period. Once the time period has elapsed, the user will no longer have access and will need to redeem another credit for continued access.- TypeScript
- Python
Creating a Trial Plan
A Trial Plan is a special type of Payment Plan that allows users to try out an AI Agent for a limited time (typically for free). A Trial Plan can only be obtained once by each user.- TypeScript
- Python
Registering an AI Agent
When you register an Agent, you need to provide the API endpoints for accessing the AI Agent, including all relevant HTTP(s) methods, URL patterns and wildcards.Before registering an AI Agent, you need to have a Payment Plan created.
- TypeScript
- Python
Register an AI Agent and Payment Plan in One Step
This method allows you to create the plan and attach the agent to it in one step.
- TypeScript
- Python
Key Concepts
Endpoint Protection
When registering an AI Agent, you specify:- Protected Endpoints: Require payment/subscription to access
- Open Endpoints: Free to access (e.g., documentation, health checks)
- URL Patterns: Support wildcards for dynamic routing
URL Patterns (path-to-regexp)
We usepath-to-regexp
to define and validate the URL patterns of your agent endpoints. This allows dynamic routing via named parameters and wildcards. See the project documentation for full syntax and options: path-to-regexp.
- Wildcard example:
agents/
and captures them into the path
array.
- Parameters example:
agentId
and taskId
as named parameters.
Payment Plan Types
Credits-Based
Sets the price per-request. Users buy a bundle of credits that are redeemed against usage.
Time-Based
Users get unlimited access for a specific time period (hours, days, months).
Trial Plans
Free access for limited time or credits to let users test your service.
Best Practices
Plan Naming
Plan Naming
Use descriptive names that clearly indicate what the plan offers (e.g., “Basic API Access - 1000 requests”).
Pricing Strategy
Pricing Strategy
Start with competitive pricing and adjust based on usage patterns and user feedback.
Endpoint Design
Endpoint Design
Group related functionality under the same payment plan to provide better value to subscribers.
Trial Plans
Trial Plans
Always offer trial plans to reduce barriers to entry and increase conversion rates.