Skip to main content

Agents

The Agents API allows AI builders to register their AI agents with the Nevermined protocol, making them discoverable and accessible through payment plans.

Overview of Agents API

The Agents API (payments.agents) enables you to:
  • Register AI agents with metadata and API endpoints
  • Associate agents with one or more payment plans
  • Register agents and plans together in a single operation
  • Update agent metadata and configuration
  • Retrieve agent information
  • Manage plan associations (add/remove plans from agents)

Agent Metadata Structure

Agents require metadata for discovery and identification:

Agent API Configuration

AgentAPIAttributes describes how requests to your agent are authenticated and (optionally) which routes are gated by your Payment Plan. All fields are optional. Most builders only need to configure how the agent is authenticated. If you integrate with the Payments library and gate paid routes via library annotations or middleware, you do not need to declare endpoints or an OpenAPI URL at registration time.

With Additional Security (opt-in)

If you want the Nevermined platform to enforce a route-level allowlist (defense-in-depth on top of your library-level gating), provide endpoints. You can also provide agentDefinitionUrl to publish a discoverable OpenAPI / MCP / A2A descriptor.
Migration note: agents registered before endpoint and agent definition fields became optional may still have these fields populated and will continue to enforce the allowlist as before. Nothing changes for them. Use the Edit Agent screen on app.nevermined.app to add or remove the configuration.

Endpoint Patterns (Additional Security)

When you opt in to the allowlist, you can use path parameters in your endpoint definitions:

Register Agents

Register Agent with Existing Plans

If you’ve already registered payment plans, you can register an agent and associate it with those plans:

Register Agent and Plan Together

For convenience, you can register both an agent and its payment plan in a single operation:

Retrieve Agents

List Your Agents

List the agents you published — the authenticated caller’s own agents. This is account management, not a marketplace search: it never returns other users’ agents. Pass an orgId to list every agent in an organization you belong to.

Get a Specific Agent

Get Plans for an Agent

Update Agent Metadata

You can update agent metadata and API configuration after registration. This is also where builders typically opt in to Additional Security by adding an endpoints allowlist or an agentDefinitionUrl to an existing agent:

Manage Agent Plans

Add Plans to an Agent

Associate additional payment plans with an existing agent:

Remove Plans from an Agent

Remove payment plan associations:

Authentication Types

The Agents API supports multiple authentication types:

Complete Example: Multi-Endpoint Agent

Best Practices

  1. Descriptive Metadata: Use clear names and descriptions for better discoverability
  2. Relevant Tags: Add tags that help users find your agent
  3. RESTful Endpoints: Follow REST conventions for endpoint paths
  4. OpenAPI Specs: Provide agent definition URLs for better integration
  5. Multiple Plans: Offer different pricing tiers for various use cases
  6. Bearer Auth: Use bearer token authentication for secure access

Source References:
  • src/api/agents-api.ts (Agents API methods)
  • tests/e2e/test_payments_e2e.test.ts (lines 373-449)
  • tests/e2e/test_x402_e2e.test.ts (agent registration examples)