AgentID Python SDK
Python SDK for verifying AI agent credentials issued by AgentID.
Installation
pip install agentid
Quick Start
from agentid import AgentIDClient
# Create client
client = AgentIDClient()
# Verify a credential by ID
result = await client.verify(credential_id="your-credential-uuid")
if result.valid:
print(f"Agent: {result.credential.agent_name}")
print(f"Permissions: {result.credential.permissions}")
else:
print(f"Invalid: {result.error.code} - {result.error.message}")
Features
- Online Verification: Verify credentials against the AgentID API
- Batch Verification: Verify multiple credentials in one request
- Offline Verification: Verify credentials locally using Ed25519 signatures
- Reputation Queries: Get trust scores for agents and issuers
- Type Safety: Full type hints with Pydantic models
Usage
Client Configuration
from agentid import AgentIDClient
# Default configuration
client = AgentIDClient()
# Custom configuration
client = AgentIDClient(
base_url="https://agentid-dashboard.vercel.app",
timeout=10.0,
)
Online Verification
# Verify by credential ID
result = await client.verify(credential_id="uuid")
# Verify a full credential payload
result = await client.verify(credential=credential_payload)
Batch Verification
result = await client.verify_batch(
credentials=[
{"credential_id": "uuid1"},
{"credential_id": "uuid2"},
{"credential": full_payload},
],
fail_fast=False,
include_details=True,
)
print(f"Valid: {result.summary.valid}/{result.summary.total}")
for item in result.results:
if item.valid:
print(f" [{item.index}] Valid: {item.credential.agent_name}")
else:
print(f" [{item.index}] Invalid: {item.error.code}")
Offline Verification
from agentid import verify_credential_offline
result = verify_credential_offline(
credential=credential_payload,
issuer_public_key="base64-encoded-public-key",
)
Reputation
# Get agent reputation
reputation = await client.get_reputation(credential_id="uuid")
print(f"Trust score: {reputation.trust_score}")
# Get leaderboard
leaderboard = await client.get_leaderboard(limit=10)
for entry in leaderboard:
print(f"{entry.rank}. {entry.agent_name} ({entry.trust_score})")
Context Manager
async with AgentIDClient() as client:
result = await client.verify(credential_id="uuid")
Error Handling
from agentid import AgentIDError, CredentialNotFoundError
try:
result = await client.verify(credential_id="invalid-uuid")
except CredentialNotFoundError:
print("Credential does not exist")
except AgentIDError as e:
print(f"Verification error: {e.code} - {e.message}")
License
MIT
Release files for agentid 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentid-1.0.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentid-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.2 kB
Release files / agentid-1.0.0.tar.gz
| Download URL | agentid-1.0.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b631ea683ce18cd9f64f7b405ffc54d10118e08a8a30519ef031341646df20ae
|
|
BLAKE2b-256 checksum How to use checksums |
c4a6d8549717d844f80595c20acdadccbdd724d306871c458be6f73ed52d5755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / agentid-1.0.0-py3-none-any.whl
| Download URL | agentid-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4209397b8b40648c39be92e13d411ec607313b4678ed019b4d8ee64d75278255
|
|
BLAKE2b-256 checksum How to use checksums |
36a6cd58fa4146eff4935fdeb6e112052b5230d5052f7e188c99b999ab18517c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|