Skip to main content

API Reference

The plugin provides slash commands for chat channels and tools for programmatic access. Each command is available in both forms.

Authentication

Login

Authenticate with Nevermined via browser login. Once authenticated, your API key is stored locally for subsequent requests. Slash command: /nvm_login [environment]
ParameterTypeRequiredDefaultDescription
environmentstringNosandboxsandbox or live
Example prompt: “Log me in to Nevermined”
/nvm_login
/nvm_login live
/nvm_login sandbox:eyJhbG...

Logout

Log out from Nevermined and remove the stored API key from the local session. Slash command: /nvm_logout
Example prompt: “Log me out of Nevermined”

Subscriber Tools

Tools for users who want to discover plans, subscribe, check balances, and query AI agents.

Check Credit Balance

Retrieve the current credit balance for a payment plan. Useful for checking how many credits remain before querying an agent or deciding whether to top up. Tool name: nevermined_checkBalance
ParameterTypeRequiredDefaultDescription
planIdstringNoConfig planIdThe payment plan ID to check
Example prompt: “How many credits do I have left on my plan?”
Returns:
{
  "planId": "did:nv:abc123...",
  "planName": "Basic Plan",
  "balance": "95",
  "isSubscriber": true
}

Get Access Token

Generate an x402 access token for authenticating requests to a Nevermined agent. The token is included in the PAYMENT-SIGNATURE header when calling an agent endpoint directly. Tool name: nevermined_getAccessToken
ParameterTypeRequiredDefaultDescription
planIdstringNoConfig planIdThe payment plan ID
agentIdstringNoConfig agentIdThe agent ID
Example prompt: “Get me an access token for the translation agent”
Returns:
{
  "accessToken": "eyJhbG..."
}

Order a Plan

Purchase a Nevermined payment plan. This subscribes you to the plan and grants the associated credits, enabling you to query any agent linked to it. Tool name: nevermined_orderPlan
ParameterTypeRequiredDefaultDescription
planIdstringNoConfig planIdThe plan ID to purchase
Example prompt: “Subscribe me to the AI Assistant plan”
Returns: Order confirmation with transaction hash.

Query an Agent

Send a prompt to a Nevermined AI agent end-to-end. This tool handles the full flow automatically: acquires an x402 access token, sends the prompt to the agent URL with the PAYMENT-SIGNATURE header, and returns the agent’s response. Tool name: nevermined_queryAgent
ParameterTypeRequiredDefaultDescription
agentUrlstringYesThe URL of the agent to query
promptstringYesThe prompt to send to the agent
planIdstringNoConfig planIdThe payment plan ID
agentIdstringNoConfig agentIdThe agent ID
methodstringNoPOSTHTTP method
Example prompt: “Ask the translation agent at https://agent.example.com to translate ‘hello’ to French”
If the agent returns a 402 (Payment Required) response, the tool returns an error indicating insufficient credits.

Builder Tools

Tools for agent builders who want to register agents and create payment plans on Nevermined.

Register an Agent

Register a new AI agent on Nevermined with an associated payment plan in a single step. This creates both the agent entry and its payment plan, making the agent discoverable and monetizable. Tool name: nevermined_registerAgent
ParameterTypeRequiredDescription
namestringYesAgent name
descriptionstringNoAgent description
agentUrlstringYesThe endpoint URL for the agent
planNamestringYesName for the payment plan
priceAmountsstringYesComma-separated price amounts in wei
priceReceiversstringYesComma-separated receiver addresses
creditsAmountnumberYesNumber of credits in the plan
tokenAddressstringNoERC20 token address (e.g. USDC). Omit for native token.
Example prompt: “Register my translation agent hosted at https://agent.example.com with a plan that costs 1 USDC for 100 credits”
Returns:
{
  "agentId": "did:nv:...",
  "planId": "did:nv:...",
  "txHash": "0x..."
}

Create a Payment Plan

Create a standalone payment plan without associating it to an agent. Supports fiat pricing (via Stripe), ERC20 tokens (e.g. USDC), and native cryptocurrency. Plans created separately can be linked to agents later. Tool name: nevermined_createPlan
ParameterTypeRequiredDescription
namestringYesPlan name
descriptionstringNoPlan description
priceAmountstringYesPrice amount — in cents for fiat (e.g. “100” = $1.00), in token smallest unit for crypto (e.g. “1000000” = 1 USDC)
receiverstringYesReceiver wallet address (0x…)
creditsAmountnumberYesNumber of credits in the plan
pricingTypestringNo"fiat" for Stripe/USD, "erc20" for ERC20 tokens, "crypto" for native token (default)
accessLimitstringNo"credits" (default) or "time"
tokenAddressstringNoERC20 token contract address. Required when pricingType is "erc20".
Example prompt: “Create a payment plan called ‘Pro Tier’ that costs $5 for 500 credits”
Returns:
{
  "planId": "did:nv:..."
}

List Payment Plans

List all payment plans owned by the authenticated builder. Useful for reviewing existing plans before creating new ones or linking them to agents. Tool name: nevermined_listPlans No parameters required.
Example prompt: “Show me all my payment plans”
Returns: Array of plan objects.