Skip to main content
You can create Payment Plans and register AI Agents manually or programmatically:
This page is for sellers/builders — publishing an agent so others can pay for it. If you only want to buy or use an existing agent, you don’t need to register anything or create a plan: see Buy & Call a Paid Agent.

Nevermined App

Go to the Nevermined App and click on “My agents” or “My pricing plans” to create 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.
Once you have a Payments instance, you can start creating Plans and registering AI Agents.

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 (as configured 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.

Creating a Credits Plan in EUR/EURC

You can also create plans priced in EUR (fiat) or EURC (Euro stablecoin):

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.

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. There are two types of trial plans:

Credits-Based Trial Plan

Perfect for giving users a fixed number of free credits to test your service:

Time-Based Trial Plan

Perfect for giving users free access for a limited time period:

Creating a Pay As You Go Plan

Pay As You Go plan is a type of payment plan that allows users to pay for each request they make to an AI Agent without having to purchase a bundle of credits upfront.

Registering an AI Agent

To register an AI Agent you only need a name, a description, and at least one Payment Plan to associate with it. The API attributes that describe how requests authenticate are configured in agentApi — most builders only need authType plus a credential.
Before registering an AI Agent, you need to have a Payment Plan created.

Additional Security: Endpoint Allowlist (opt-in)

If you want the Nevermined platform to enforce a route-level allowlist on top of your library middleware, provide endpoints (TypeScript and Python) and, for public routes, openEndpoints (TypeScript) or open_endpoints (Python). When set, only requests matching one of the configured entries are accepted during x402 verification; non-matching requests are rejected. You can also publish a discoverable agent definition by setting agentDefinitionUrl (TypeScript) or agent_definition_url (Python).
Existing agents registered before April 2026 still have these fields populated and continue to enforce the allowlist as before. No migration is needed.

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.
Note: The accessLimit parameter is optional. If not specified, it is automatically inferred based on creditsConfig.durationSecs:
  • "credits" if durationSecs === 0n (non-expirable plans)
  • "time" if durationSecs > 0n (expirable plans)
You can explicitly set it if needed:

Key Concepts

Endpoint Protection (opt-in)

The fields below are part of the optional Additional Security allowlist described above — they only apply when you explicitly populate endpoints and/or openEndpoints (TypeScript) / open_endpoints (Python). For most builders integrating via the Payments library middleware, route-level gating is handled by your application code and these fields can be omitted entirely.
  • Protected Endpoints (endpoints): URLs that require a valid Payment Plan subscription. When present, x402 verify accepts only requests matching one of these entries.
  • Open Endpoints (openEndpoints / open_endpoints): URLs that are publicly accessible (e.g., documentation, health checks).
  • URL Patterns: Support wildcards for dynamic routing — see below.

URL Patterns (path-to-regexp)

We use path-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:
Matches one or more segments after agents/ and captures them into the path array.
  • Parameters example:
Captures 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.

Pay As You Go

Pay for each request they make to an AI Agent without having to purchase a bundle of credits upfront.

Best Practices

Use descriptive names that clearly indicate what the plan offers (e.g., “Basic API Access - 1000 requests”).
Start with competitive pricing and adjust based on usage patterns and user feedback.
Group related functionality under the same payment plan to provide better value to subscribers.
Always offer trial plans to reduce barriers to entry and increase conversion rates.

Next Steps

Once you have registered your agents and plans, you can:

Test Purchasing

Learn how users purchase your payment plans

Handle Requests

Implement request validation in your AI agent