Skip to content

Registration (HTTP)

Register your agent on-chain with a direct HTTP/HTTPS URL to your registration file.

HTTP registration is useful when:

  • You host your own registration files
  • You want full control over file serving
  • You prefer traditional hosting over IPFS
# Create and configure your agent
agent = sdk.createAgent(
name="My AI Agent",
description="Agent description",
image="https://example.com/image.png"
)
agent.setMCP("https://mcp.example.com/")
agent.setA2A("https://a2a.example.com/agent.json")
agent.setENS("myagent.eth")
agent.setTrust(reputation=True)

Get the JSON content from the SDK:

# Get the registration file object
registration_file = agent.registrationFile()
# Convert to dictionary (JSON-ready)
registration_data = registration_file.to_dict()
# Or get as formatted JSON string
json_content = str(registration_file) # Pretty-printed JSON

Save the JSON content to your web server:

# Save to file
with open("my-agent.json", "w") as f:
f.write(json_content)
# Upload to your web server
# Example URLs:
# https://yourdomain.com/agents/my-agent.json
# https://yourusername.github.io/agents/my-agent.json
# Register with your HTTP URL
agent.registerHTTP("https://yourdomain.com/agents/my-agent.json")
print(f"Agent registered: {agent.agentId}")
print(f"Agent URI: {agent.agentURI}") # https://yourdomain.com/...
from agent0_sdk import SDK
# Initialize SDK
sdk = SDK(
chainId=11155111,
rpcUrl="https://sepolia.infura.io/v3/YOUR_PROJECT_ID",
signer=private_key
)
# 1. Configure agent
agent = sdk.createAgent(
name="My AI Agent",
description="A helpful AI assistant",
image="https://example.com/agent.png"
)
agent.setMCP("https://mcp.example.com/")
agent.setA2A("https://a2a.example.com/agent.json")
# 2. Generate registration file
registration_data = agent.registrationFile().to_dict()
json_content = str(agent.registrationFile())
# 3. Save and upload to your server
with open("my-agent.json", "w") as f:
f.write(json_content)
# Upload to: https://yourdomain.com/agents/my-agent.json
# 4. Register on-chain
agent.registerHTTP("https://yourdomain.com/agents/my-agent.json")
print(f"✅ Agent registered: {agent.agentId}")

To update an agent:

# 1. Load existing agent
agent = sdk.loadAgent("11155111:123")
# 2. Modify configuration
agent.updateInfo(description="Updated description")
agent.setMCP("https://new-mcp.example.com")
# 3. Generate new registration file
json_content = str(agent.registrationFile())
# 4. Upload updated file to your server
with open("my-agent-updated.json", "w") as f:
f.write(json_content)
# 5. Update URI on-chain (only if the URI has changed)
agent.setAgentUri("https://yourdomain.com/agents/my-agent-updated.json")

The SDK generates ERC-8004 compliant registration files:

{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "My AI Agent",
"description": "Agent description",
"image": "https://example.com/image.png",
"endpoints": [
{
"name": "MCP",
"endpoint": "https://mcp.example.com/",
"version": "2025-06-18",
"mcpTools": ["tool1", "tool2"],
"mcpPrompts": ["prompt1"],
"mcpResources": ["resource1"]
},
{
"name": "A2A",
"endpoint": "https://a2a.example.com/agent.json",
"version": "0.30",
"a2aSkills": ["skill1", "skill2"]
}
],
"registrations": [
{
"agentId": 123,
"agentRegistry": "eip155:11155111:0x8004a6090Cd10A7288092483047B097295Fb8847"
}
],
"supportedTrust": ["reputation"],
"active": true,
"x402support": false,
"updatedAt": 1234567890
}