Skip to main content
GET
/
.well-known
/
agent.json
A2A Protocol Endpoints
curl --request GET \
  --url https://api.example.com/.well-known/agent.json \
  --header 'Authorization: Bearer <token>'

A2A Protocol Endpoints

The A2A (Agent-to-Agent) protocol enables communication between AI agents. These endpoints expose PraisonAI agents via the A2A protocol.

Base URL

http://localhost:8000

Endpoints

Get Agent Card

Retrieve the Agent Card for discovery.
GET
/.well-known/agent.json
Returns the Agent Card JSON for A2A discovery
Response
{
  "name": "PraisonAI Agent",
  "description": "PraisonAI Agent via A2A",
  "url": "http://localhost:8000/a2a",
  "version": "1.0.0",
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "stateTransitionHistory": false
  },
  "skills": [
    {
      "id": "chat",
      "name": "Chat",
      "description": "General conversation"
    }
  ]
}

Get Status

Check server status.
GET
/status
Returns server status
Response
{
  "status": "ok",
  "name": "PraisonAI Agent",
  "version": "1.0.0"
}

Send Message (JSON-RPC)

Send a message to the agent via JSON-RPC.
POST
/a2a
JSON-RPC endpoint for A2A messages
Request Body
{
  "jsonrpc": "2.0",
  "method": "message/send",
  "id": "request-123",
  "params": {
    "message": {
      "role": "user",
      "parts": [
        {
          "type": "text",
          "text": "Hello, agent!"
        }
      ]
    }
  }
}
Response
{
  "jsonrpc": "2.0",
  "id": "request-123",
  "result": {
    "message": {
      "role": "agent",
      "parts": [
        {
          "type": "text",
          "text": "Hello! How can I help you today?"
        }
      ]
    }
  }
}

Usage Example

Python Client

import requests

# Get Agent Card
response = requests.get("http://localhost:8000/.well-known/agent.json")
agent_card = response.json()
print(f"Agent: {agent_card['name']}")

# Send Message
message = {
    "jsonrpc": "2.0",
    "method": "message/send",
    "id": "1",
    "params": {
        "message": {
            "role": "user",
            "parts": [{"type": "text", "text": "Hello!"}]
        }
    }
}
response = requests.post("http://localhost:8000/a2a", json=message)
print(response.json())

Setting Up A2A Server

from praisonaiagents import Agent
from praisonaiagents.ui.a2a import A2A
from fastapi import FastAPI
import uvicorn

# Create agent
agent = Agent(
    name="Assistant",
    role="Helpful AI Assistant",
    goal="Help users with their questions"
)

# Create A2A interface
a2a = A2A(
    agent=agent,
    url="http://localhost:8000/a2a"
)

# Create FastAPI app
app = FastAPI()
app.include_router(a2a.get_router())

# Run server
uvicorn.run(app, host="0.0.0.0", port=8000)
  • A2A SDK - A2A SDK documentation
  • Agent - Agent configuration