curl -X GET "https://api.credprotocol.com/api/v2/agents/1" \
-H "Authorization: Bearer YOUR_API_KEY"
const agentId = 1;
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/${agentId}`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const agent = await response.json();
console.log(`Agent ${agent.agent_id} owned by ${agent.owner}`);
import requests
agent_id = 1
response = requests.get(
f'https://api.credprotocol.com/api/v2/agents/{agent_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
agent = response.json()
print(f"Agent {agent['agent_id']} owned by {agent['owner']}")
{
"agent_id": 1,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Example Agent",
"description": "An example AI agent registered on-chain",
"image": "ipfs://QmExample123"
}
}
{
"detail": "Agent 999 does not exist in the Identity Registry"
}
{
"detail": [
{
"type": "greater_than_equal",
"loc": ["path", "agent_id"],
"msg": "Input should be greater than or equal to 1"
}
]
}
Agents
Get Agent Info
Check if an agent exists and get its owner address
GET
/
api
/
v2
/
agents
/
{agent_id}
curl -X GET "https://api.credprotocol.com/api/v2/agents/1" \
-H "Authorization: Bearer YOUR_API_KEY"
const agentId = 1;
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/${agentId}`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const agent = await response.json();
console.log(`Agent ${agent.agent_id} owned by ${agent.owner}`);
import requests
agent_id = 1
response = requests.get(
f'https://api.credprotocol.com/api/v2/agents/{agent_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
agent = response.json()
print(f"Agent {agent['agent_id']} owned by {agent['owner']}")
{
"agent_id": 1,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Example Agent",
"description": "An example AI agent registered on-chain",
"image": "ipfs://QmExample123"
}
}
{
"detail": "Agent 999 does not exist in the Identity Registry"
}
{
"detail": [
{
"type": "greater_than_equal",
"loc": ["path", "agent_id"],
"msg": "Input should be greater than or equal to 1"
}
]
}
Overview
Returns whether an agent exists in the ERC-8004 Identity Registry on Base, along with its owner address. Use this to validate an agent ID before submitting reputation feedback.This is a free endpoint (0 Cred Units). It reads directly from the on-chain Identity Registry contract on Base.
Authentication
| Method | Header | Cost |
|---|---|---|
| API Token | Authorization: Bearer YOUR_API_KEY | 0 Cred Units |
| x402 Payment | X-PAYMENT: <signed_payment> | Free |
Path Parameters
integer
required
ERC-8004 agent ID (ERC-721 token ID in the Identity Registry). Must be >= 1.
Response
integer
The ERC-8004 agent ID
string
Ethereum address of the agent’s owner (checksummed)
object
Agent registration metadata from tokenURI (null if unavailable)
string
Agent name from registration metadata
string
Agent description from registration metadata
string
Agent image URI from registration metadata
curl -X GET "https://api.credprotocol.com/api/v2/agents/1" \
-H "Authorization: Bearer YOUR_API_KEY"
const agentId = 1;
const response = await fetch(`https://api.credprotocol.com/api/v2/agents/${agentId}`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const agent = await response.json();
console.log(`Agent ${agent.agent_id} owned by ${agent.owner}`);
import requests
agent_id = 1
response = requests.get(
f'https://api.credprotocol.com/api/v2/agents/{agent_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
agent = response.json()
print(f"Agent {agent['agent_id']} owned by {agent['owner']}")
{
"agent_id": 1,
"owner": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"metadata": {
"name": "Example Agent",
"description": "An example AI agent registered on-chain",
"image": "ipfs://QmExample123"
}
}
{
"detail": "Agent 999 does not exist in the Identity Registry"
}
{
"detail": [
{
"type": "greater_than_equal",
"loc": ["path", "agent_id"],
"msg": "Input should be greater than or equal to 1"
}
]
}
Performance
- Response Time: Typically under 1 second
- Data Source: On-chain
ownerOf()call to the Identity Registry on Base (chain 8453)