Skip to main content
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

Define how your agent’s API endpoints can be accessed:

Endpoint Patterns

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

Get a Specific Agent

Get Plans for an Agent

Update Agent Metadata

You can update agent metadata and API configuration after registration:

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)