STABLEAI Engineer Foundation + W3C

Agent Protocol

2 min read

A standardized REST API specification for exposing AI agents as services.

Overview

Agent Protocol answers a simple question: if you want to deploy an AI agent as a service, what should the API look like?

It provides an OpenAPI specification that any agent—regardless of framework—can implement to expose a consistent REST interface.

Core Endpoints

POST /ap/v1/agent/tasks           # Create a new task
GET  /ap/v1/agent/tasks           # List all tasks
GET  /ap/v1/agent/tasks/{id}      # Get task details
POST /ap/v1/agent/tasks/{id}/steps  # Execute next step
GET  /ap/v1/agent/tasks/{id}/steps  # List task steps

Key Features

No SDK Required

Agent Protocol uses standard HTTP—you can interact with agents using cURL, Postman, or any HTTP client.

Framework Agnostic

Implement the API in any language/framework. AutoGPT, LangChain agents, and custom implementations all work.

Step-Based Execution

Tasks are executed step-by-step, allowing for:

  • Progress tracking
  • Intermediate results
  • Human intervention between steps

W3C Community Group

The W3C has established an AI Agent Protocol Community Group to:

  • Develop open, interoperable protocols
  • Enable agent discovery across the web
  • Standardize agent communication

Specification: https://w3c-cg.github.io/ai-agent-protocol/protocol.html

Relationship with A2A

Agent Protocol and A2A serve different purposes:

Aspect Agent Protocol A2A
Focus HTTP API surface Agent communication
Use Case Exposing single agent Multi-agent collaboration
Complexity Simple REST Rich task lifecycle

Some projects are discussing migration to A2A for agent-to-agent scenarios while keeping Agent Protocol for simple API exposure.

When to Use Agent Protocol

Use Agent Protocol for:

  • Deploying agents as REST services
  • Simple agent integrations
  • AutoGPT-compatible implementations

Consider A2A for:

  • Multi-agent systems
  • Rich task negotiation
  • Enterprise deployments
Example Code
# Create and execute an agent task
import requests

# Create a task
response = requests.post(
    "https://agent.example.com/ap/v1/agent/tasks",
    json={"input": "Summarize this document..."}
)
task_id = response.json()["task_id"]

# Execute steps until complete
while True:
    step = requests.post(
        f"https://agent.example.com/ap/v1/agent/tasks/{task_id}/steps"
    ).json()

    if step["is_last"]:
        print(f"Result: {step['output']}")
        break
Quick Info
Architectureclient-server
Message FormatJSON (OpenAPI)
TransportHTTP/HTTPS
SDKsPython, TypeScript, Any (REST)
Agent-to-Agent Features
Discovery
Negotiation
Streaming
Bidirectional
Multi-Agent
Stay Updated

Get notified when protocols evolve.

Subscribe
Strengths
  • Simple REST API design
  • No SDK required
  • OpenAPI specification
  • Wide AutoGPT ecosystem
  • W3C standardization efforts
Considerations
  • Limited to single-agent scenarios
  • No streaming support
  • Less rich than A2A
  • Considering migration to A2A
Tags
restopenapiautogptw3c

Compare with Other Protocols

Compare against:(2/2)
Agent Protocol(current)
Strengths
Agent Protocol
stable
  • Simple REST API design
  • No SDK required
  • OpenAPI specification
AG-UI Protocol
beta
  • Purpose-built for frontend integration
  • Human-in-the-loop patterns built-in
  • Framework-agnostic design
Agent Name Service (ANS)
experimental
  • Leverages existing DNS infrastructure
  • Cryptographic identity via PKI
  • Scalable and decentralized
Considerations
Agent Protocol
  • Limited to single-agent scenarios
  • No streaming support
  • Less rich than A2A
AG-UI Protocol
  • Frontend-specific scope
  • No agent discovery
  • Smaller community than MCP/A2A
Agent Name Service (ANS)
  • Early draft stage
  • Requires PKI infrastructure
  • DNS propagation delays
Best For
Agent Protocol
Deploying agents as web servicesAutoGPT integrationsSimple agent APIsAgent benchmarking
AG-UI Protocol
AI-powered chat interfacesCollaborative document editingApproval workflow UIsReal-time agent dashboards
Agent Name Service (ANS)
Finding agents by capabilityVerifying agent identityCross-platform discovery
Technical Details
Agent ProtocolAG-UI ProtocolAgent Name Service (ANS)
Architectureclient-serverevent-drivendistributed
Message FormatJSON (OpenAPI)JSON EventsDNS Records
TransportHTTP/HTTPSSSE, WebSocket, HTTP WebhooksDNS
Version1.01.0draft-00
SDKsPython, TypeScript, Any (REST)TypeScript, Python, React
Architecture
Agent Protocolclient-server
AG-UI Protocolevent-driven
Agent Name Service (ANS)distributed
Message Format
Agent ProtocolJSON (OpenAPI)
AG-UI ProtocolJSON Events
Agent Name Service (ANS)DNS Records
Transport
Agent ProtocolHTTP/HTTPS
AG-UI ProtocolSSE, WebSocket, HTTP Webhooks
Agent Name Service (ANS)DNS
Version
Agent Protocol1.0
AG-UI Protocol1.0
Agent Name Service (ANS)draft-00
SDKs
Agent ProtocolPython, TypeScript, Any (REST)
AG-UI ProtocolTypeScript, Python, React
Agent Name Service (ANS)