Managing AI Agents
Complete guide to registering and managing AI agents with the Nevermined CLI.Overview
AI agents are services that users can access by purchasing payment plans. Agents can be:- AI assistants: Chat-based conversational agents
- API services: REST APIs with metered access
- Data pipelines: Processing services with usage tracking
- Tools: Utility services with pay-per-use billing
Listing Agent Plans
Get the list of plans that can be ordered to access an agent:Getting Agent Details
Retrieve detailed information about a specific agent:- Agent metadata (name, description, creator)
- API endpoint configuration
- Associated payment plans
Registering Agents
Register Agent with Existing Plans
Register a new AI agent and associate it with one or more existing payment plans:--agent-api is a JSON object (AgentAPIAttributes), not a bare URL — pass a file or an inline JSON string. See Config schemas for the full shape.
agent-metadata.json:
Register Agent and Plan Together
Register a new AI agent and create a payment plan for it in a single command:--access-limit—creditsortime. When omitted, it is derived from the credits config:timeifdurationSecs > 0, otherwisecredits.
--* flag accepts either a path to a .json file or an inline JSON string (anything ending in .json is read as a file; everything else is parsed as JSON). Note that --agent-api is a JSON object (AgentAPIAttributes), not a bare URL.
The four config flags map to the SDK types — see Config schemas below for the full field reference and the helper commands that generate them.
agent-api.json (AgentAPIAttributes):
endpoints is commonly needed; openEndpoints and the auth fields (authType, username, password, token) are optional.
plan-metadata.json (PlanMetadata):
PlanPriceConfig) — a free plan (no charge to subscribe):
amounts to the price in the token’s smallest unit and receivers to the wallet that collects it (this is what nevermined plans get-native-token-price-config / get-erc20-price-config emit):
PlanCreditsConfig) — grant 100 credits, burn 1 per request:
Config schemas
register-agent-and-plan (and nevermined plans register-credits-plan) accept these JSON shapes. They match the SDK types exactly — the easiest way to produce a valid file is to run the matching nevermined plans get-*-config command and save its output, rather than hand-crafting the JSON.
--price-config (PlanPriceConfig)
| Field | Type | Notes |
|---|---|---|
isCrypto | boolean | true for crypto/native/ERC-20 payments, false for fiat (Stripe/Braintree). Required. |
amounts | number[] | Price(s) in the token’s smallest unit (6-decimal units for USDC/EURC; 2000000 = $2.00). Empty [] for a free plan. |
receivers | string[] | Wallet address(es) that collect the payment. Empty [] for a free plan. Same length as amounts. |
tokenAddress | string | ERC-20 token address, or the zero address (0x0000…0000) for the native token / free / fiat plans. |
contractAddress | string | Price-calculator contract. Zero address unless using a smart-contract price. |
feeController | string | Fee-controller contract. Zero address uses the default. |
externalPriceAddress | string | External price contract. Zero address when unused. |
templateAddress | string | Template contract. Zero address except for pay-as-you-go plans. |
currency | string | Optional: USD, EUR, USDC, or EURC. When omitted, the backend infers it from the payment type. |
nevermined plans get-free-price-config, get-native-token-price-config, get-crypto-price-config, get-erc20-price-config, get-eurc-price-config, get-fiat-price-config, get-pay-as-you-go-price-config.
--credits-config (PlanCreditsConfig)
| Field | Type | Notes |
|---|---|---|
isRedemptionAmountFixed | boolean | true when every request burns a fixed number of credits (minAmount == maxAmount), false for a dynamic range. |
redemptionType | number | Who may redeem credits: 0 = global burner role, 1 = plan owner, 2 = plan role, 4 = subscriber. SDK helpers use 4 (ONLY_SUBSCRIBER). |
onchainMirror | boolean | false keeps the credit ledger off-chain (default). true mirrors each burn to the on-chain NFT1155Credits contract. |
durationSecs | number | Plan lifetime in seconds. 0 = non-expirable (credit-limited). > 0 makes it a time-limited plan. |
amount | number | Credits granted when the plan is purchased. |
minAmount | number | Minimum credits burned per request. |
maxAmount | number | Maximum credits burned per request (equal to minAmount for fixed plans). |
nftAddress | string | Optional: NFT contract representing the plan’s credits. Normally omitted — assigned by the backend. |
nevermined plans get-fixed-credits-config, get-dynamic-credits-config, get-expirable-duration-config, get-non-expirable-duration-config, get-pay-as-you-go-credits-config.
--agent-api (AgentAPIAttributes)
| Field | Type | Notes |
|---|---|---|
endpoints | object[] | Allowlist of paid upstream endpoints, each { "<HTTP-VERB>": "<url>" } (e.g. { "POST": "https://…/:agentId/tasks" }). Optional defense-in-depth on top of your library middleware. |
openEndpoints | string[] | Endpoints that do not require a subscription (docs, health, etc.). Optional. |
agentDefinitionUrl | string | Optional link to an OpenAPI spec, MCP manifest, or A2A agent card (metadata only). |
authType | string | Upstream auth: none, basic, bearer, or oauth. Optional. |
username / password | string | Upstream credentials when authType is basic. |
token | string | Upstream bearer token when authType is bearer or oauth. |
agentApiAttributes in the request body — you supply the unwrapped AgentAPIAttributes shown above.
Generating valid configs
Updating Agents
Update Agent Metadata
Modify agent name, description, API endpoint, or other metadata:--agent-metadata and --agent-api are required. As with registration, --agent-api is a JSON object (AgentAPIAttributes), not a bare URL.
updated-metadata.json:
Managing Payment Plans
Add Payment Plan to Agent
Associate an existing payment plan with an agent:Remove Payment Plan from Agent
Disassociate a payment plan from an agent:List Plans Associated with Agent
See which plans give access to an agent:Integration Examples
Example 1: Full Agent Setup
Complete workflow to register and configure an AI agent:Example 2: One-Step Agent and Plan Registration
Register an agent and its payment plan in a single command:Example 3: Multi-Plan Agent
Register an agent with multiple pricing tiers:JSON Output for Automation
Use--format json to integrate with other tools:
Best Practices
1. Use Descriptive Metadata
Provide comprehensive information about your agent:2. Implement Proper API Endpoints
Ensure your agent API follows best practices:- Use HTTPS for all endpoints
- Implement rate limiting
- Return proper HTTP status codes
- Include error handling