Core Methods
Get Agent
Retrieves information about a registered AI agent, including metadata and associated payment plans.
GET
/
agent
/
{agentId}
Get Agent
curl --request GET \
--url http://sandbox.mintlify.com/agent/{agentId} \
--header 'Authorization: Bearer <token>'import requests
url = "http://sandbox.mintlify.com/agent/{agentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://sandbox.mintlify.com/agent/{agentId}', 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 => "http://sandbox.mintlify.com/agent/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://sandbox.mintlify.com/agent/{agentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://sandbox.mintlify.com/agent/{agentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://sandbox.mintlify.com/agent/{agentId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"metadata": {
"name": "<string>",
"tags": [
"<string>"
],
"dateCreated": "2023-11-07T05:31:56Z"
},
"plans": [
{
"planId": "<string>",
"metadata": {
"name": "<string>",
"description": "<string>"
},
"price": {
"priceType": "<string>",
"tokenAddress": "<string>",
"amounts": [
123
],
"receivers": [
"<string>"
]
},
"credits": {
"creditsType": "<string>",
"amount": 123,
"durationOfThePlan": 123
},
"nftAddress": "<string>"
}
]
}Retrieves information about a registered AI agent, including metadata and associated payment plans.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| agentId | string | Yes | The unique identifier of the agent to retrieve |
Example Request
const agent: Agent = await payments.getAgent(agentId)
Response Structure
interface Agent {
agentId: string
metadata: AgentMetadata
plans: PaymentPlan[]
}
interface AgentMetadata {
name: string
tags: string[]
dateCreated: string
}
interface PaymentPlan {
planId: string
metadata: PlanMetadata
price: PriceConfig
credits: CreditsConfig
nftAddress: string
}
Example Response
{
"agentId": "0xabc123...",
"metadata": {
"name": "Legal Assistant",
"tags": ["legal", "ai"],
"dateCreated": "2024-01-10T00:00:00Z"
},
"plans": [
{
"planId": "0xdef456...",
"metadata": {
"name": "Premium Legal Plan",
"description": "Monthly subscription for legal assistance"
},
"price": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0xUSDC...",
"amounts": [10000000],
"receivers": ["0xbuilderAddress"]
},
"credits": {
"creditsType": "EXPIRABLE",
"amount": 1,
"durationOfThePlan": 2592000
},
"nftAddress": "0x..."
}
]
}
Notes
- You must initialize the
Paymentsclient with a validnvmApiKeybefore callinggetAgent. - The returned object includes all plans currently associated with the agent.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the agent to retrieve
Previous
Query AgentQueries a registered AI agent via the Nevermined Proxy or directly, using a valid payment plan and signature-based access token.
Next
⌘I
Get Agent
curl --request GET \
--url http://sandbox.mintlify.com/agent/{agentId} \
--header 'Authorization: Bearer <token>'import requests
url = "http://sandbox.mintlify.com/agent/{agentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://sandbox.mintlify.com/agent/{agentId}', 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 => "http://sandbox.mintlify.com/agent/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://sandbox.mintlify.com/agent/{agentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://sandbox.mintlify.com/agent/{agentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://sandbox.mintlify.com/agent/{agentId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"metadata": {
"name": "<string>",
"tags": [
"<string>"
],
"dateCreated": "2023-11-07T05:31:56Z"
},
"plans": [
{
"planId": "<string>",
"metadata": {
"name": "<string>",
"description": "<string>"
},
"price": {
"priceType": "<string>",
"tokenAddress": "<string>",
"amounts": [
123
],
"receivers": [
"<string>"
]
},
"credits": {
"creditsType": "<string>",
"amount": 123,
"durationOfThePlan": 123
},
"nftAddress": "<string>"
}
]
}