Register Agent and Plan
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentMetadata": {
"name": "Legal Assistant",
"description": "AI-powered legal analysis",
"tags": [
"legal",
"ai"
]
},
"agentApi": {
"endpoints": [
{
"POST": "https://your-api.com/query"
}
],
"agentDefinitionUrl": "https://your-api.com/openapi.json"
},
"planMetadata": {
"name": "Starter Plan",
"description": "100 requests for $10"
},
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [
10000000
],
"receivers": [
"0xYourWalletAddress"
]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 100,
"minAmount": 1
},
"accessLimit": "credits"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans"
payload = {
"agentMetadata": {
"name": "Legal Assistant",
"description": "AI-powered legal analysis",
"tags": ["legal", "ai"]
},
"agentApi": {
"endpoints": [{ "POST": "https://your-api.com/query" }],
"agentDefinitionUrl": "https://your-api.com/openapi.json"
},
"planMetadata": {
"name": "Starter Plan",
"description": "100 requests for $10"
},
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [10000000],
"receivers": ["0xYourWalletAddress"]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 100,
"minAmount": 1
},
"accessLimit": "credits"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentMetadata: {
name: 'Legal Assistant',
description: 'AI-powered legal analysis',
tags: ['legal', 'ai']
},
agentApi: {
endpoints: [{POST: 'https://your-api.com/query'}],
agentDefinitionUrl: 'https://your-api.com/openapi.json'
},
planMetadata: {name: 'Starter Plan', description: '100 requests for $10'},
priceConfig: {
priceType: 'FIXED_PRICE',
tokenAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amounts: [10000000],
receivers: ['0xYourWalletAddress']
},
creditsConfig: {creditsType: 'FIXED', amount: 100, minAmount: 1},
accessLimit: 'credits'
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentMetadata' => [
'name' => 'Legal Assistant',
'description' => 'AI-powered legal analysis',
'tags' => [
'legal',
'ai'
]
],
'agentApi' => [
'endpoints' => [
[
'POST' => 'https://your-api.com/query'
]
],
'agentDefinitionUrl' => 'https://your-api.com/openapi.json'
],
'planMetadata' => [
'name' => 'Starter Plan',
'description' => '100 requests for $10'
],
'priceConfig' => [
'priceType' => 'FIXED_PRICE',
'tokenAddress' => '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
'amounts' => [
10000000
],
'receivers' => [
'0xYourWalletAddress'
]
],
'creditsConfig' => [
'creditsType' => 'FIXED',
'amount' => 100,
'minAmount' => 1
],
'accessLimit' => 'credits'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans"
payload := strings.NewReader("{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"agentId": "<string>",
"planId": "<string>"
}Agents
Register Agent and Plan
Creates both an agent and associated payment plan in a single request.
POST
/
protocol
/
agents
/
plans
Register Agent and Plan
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentMetadata": {
"name": "Legal Assistant",
"description": "AI-powered legal analysis",
"tags": [
"legal",
"ai"
]
},
"agentApi": {
"endpoints": [
{
"POST": "https://your-api.com/query"
}
],
"agentDefinitionUrl": "https://your-api.com/openapi.json"
},
"planMetadata": {
"name": "Starter Plan",
"description": "100 requests for $10"
},
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [
10000000
],
"receivers": [
"0xYourWalletAddress"
]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 100,
"minAmount": 1
},
"accessLimit": "credits"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans"
payload = {
"agentMetadata": {
"name": "Legal Assistant",
"description": "AI-powered legal analysis",
"tags": ["legal", "ai"]
},
"agentApi": {
"endpoints": [{ "POST": "https://your-api.com/query" }],
"agentDefinitionUrl": "https://your-api.com/openapi.json"
},
"planMetadata": {
"name": "Starter Plan",
"description": "100 requests for $10"
},
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [10000000],
"receivers": ["0xYourWalletAddress"]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 100,
"minAmount": 1
},
"accessLimit": "credits"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentMetadata: {
name: 'Legal Assistant',
description: 'AI-powered legal analysis',
tags: ['legal', 'ai']
},
agentApi: {
endpoints: [{POST: 'https://your-api.com/query'}],
agentDefinitionUrl: 'https://your-api.com/openapi.json'
},
planMetadata: {name: 'Starter Plan', description: '100 requests for $10'},
priceConfig: {
priceType: 'FIXED_PRICE',
tokenAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amounts: [10000000],
receivers: ['0xYourWalletAddress']
},
creditsConfig: {creditsType: 'FIXED', amount: 100, minAmount: 1},
accessLimit: 'credits'
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentMetadata' => [
'name' => 'Legal Assistant',
'description' => 'AI-powered legal analysis',
'tags' => [
'legal',
'ai'
]
],
'agentApi' => [
'endpoints' => [
[
'POST' => 'https://your-api.com/query'
]
],
'agentDefinitionUrl' => 'https://your-api.com/openapi.json'
],
'planMetadata' => [
'name' => 'Starter Plan',
'description' => '100 requests for $10'
],
'priceConfig' => [
'priceType' => 'FIXED_PRICE',
'tokenAddress' => '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
'amounts' => [
10000000
],
'receivers' => [
'0xYourWalletAddress'
]
],
'creditsConfig' => [
'creditsType' => 'FIXED',
'amount' => 100,
'minAmount' => 1
],
'accessLimit' => 'credits'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans"
payload := strings.NewReader("{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentMetadata\": {\n \"name\": \"Legal Assistant\",\n \"description\": \"AI-powered legal analysis\",\n \"tags\": [\n \"legal\",\n \"ai\"\n ]\n },\n \"agentApi\": {\n \"endpoints\": [\n {\n \"POST\": \"https://your-api.com/query\"\n }\n ],\n \"agentDefinitionUrl\": \"https://your-api.com/openapi.json\"\n },\n \"planMetadata\": {\n \"name\": \"Starter Plan\",\n \"description\": \"100 requests for $10\"\n },\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 10000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 100,\n \"minAmount\": 1\n },\n \"accessLimit\": \"credits\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"agentId": "<string>",
"planId": "<string>"
}Authorizations
Your Nevermined API Key (starts with 'nvm:'). Get one at nevermined.app under Settings > API Keys.
Body
application/json
Agent and plan configuration
⌘I