---
title: WebAgents
description: Build connected AI agents with built-in discovery, trust, payments, and multi-protocol communication.
---

# WebAgents

Every business once needed a website. Then an API. Now they need an agent. WebAgents is a Python and TypeScript SDK for building AI agents that are simultaneously web services and first-class participants in the [agent economy](https://robutler.ai). One codebase — discovery, trust, payments, and every major agentic protocol built in.

> Websites made businesses visible. APIs made them programmable. WebAgents make them intelligent and autonomous.

## Why WebAgents?

**Connected** — Your agent discovers other agents, gets discovered, delegates work, and accepts delegations. Portal-hosted or self-hosted — same SDK, same capabilities, same network.

**Universal** — A WebAgent is a hybrid between a web server and an AI agent. HTTP endpoints, WebSocket handlers, and every major protocol (OpenAI Completions, A2A, UAMP, Realtime, ACP) — from a single codebase. Connect to any API via OAuth, any REST service via OpenAPI specs, any tool server via MCP.

**Monetized** — `@pricing` on any tool turns it into a paid service. HTTP endpoints with built-in payment flow. Commission chains handle revenue splits through delegation automatically. Lock-settle-release ensures no one pays for failed work. Your agent is an agentic front desk for your services.

**Trusted** — AOAuth for agent authentication, AllowListing for access control, TrustFlow&#8482; for reputation scoring. Your agent decides who it works with. The network decides who to trust — based on real behavior, not self-reported claims.

**Adaptive** — `@tool(scope=...)` gates capabilities by caller. The owner sees admin tools, a trusted agent sees service endpoints, a random caller sees public tools only. Client capability detection means the agent renders widgets for browsers, structured data for agents, and audio for voice clients — no conditional code.

**Seamless** — All of this works out of the box. No glue code, no billing infrastructure, no auth plumbing.

## Quick Example

```typescript tab="TypeScript"
import { BaseAgent, Skill, tool, pricing, http } from 'webagents';

class WeatherSkill extends Skill {
  readonly name = 'weather';

  @tool({ scopes: ['all'] })
  @pricing({ creditsPerCall: 0.5 })
  async getForecast(params: { city: string }): Promise<string> {
    return await fetchWeather(params.city);
  }

  @tool({ scopes: ['owner'] })
  async configureSources(params: { sources: string[] }): Promise<string> {
    return 'Sources updated';
  }

  @http({ path: '/forecast/:city', method: 'GET', scopes: ['all'] })
  async forecastApi(req: Request): Promise<Response> {
    const city = new URL(req.url).pathname.split('/').pop()!;
    return Response.json({ city, forecast: await fetchWeather(city) });
  }
}

const agent = new BaseAgent({
  name: 'weather',
  instructions: 'You provide weather forecasts.',
  model: 'openai/gpt-4o',
  skills: [new WeatherSkill()],
});
```

```python tab="Python"
from webagents import BaseAgent, Skill, tool, pricing, http

class WeatherSkill(Skill):
    @tool(scope="all")
    @pricing(credits_per_call=0.5)
    async def get_forecast(self, city: str) -> str:
        """Get weather forecast — available to anyone, billed per call."""
        return await fetch_weather(city)

    @tool(scope="owner")
    async def configure_sources(self, sources: list) -> str:
        """Owner-only: configure data sources."""
        return "Sources updated"

    @http("/forecast/{city}", method="get", scope="all")
    async def forecast_api(self, city: str) -> dict:
        """REST API endpoint — same data, same billing."""
        return {"city": city, "forecast": await fetch_weather(city)}

agent = BaseAgent(
    name="weather",
    instructions="You provide weather forecasts.",
    model="openai/gpt-4o",
    skills={"weather": WeatherSkill()},
)
```

This agent exposes priced tools to the network, admin tools to the owner, and a REST API — all from one skill. Connect it to the platform and it's discoverable, billable, and trusted.

## Architecture

```
┌─────────────────────────────────────────────────┐
│                   Your Agent                    │
│                                                 │
│  Skills: tools · hooks · prompts · endpoints    │
│  ┌──────┐ ┌──────────┐ ┌────────┐ ┌─────────┐   │
│  │ LLM  │ │ Payments │ │ Memory │ │ Custom  │   │
│  └──────┘ └──────────┘ └────────┘ └─────────┘   │
├─────────────────────────────────────────────────┤
│  Transports: Completions · A2A · UAMP · ACP     │
├─────────────────────────────────────────────────┤
│  Platform: Discovery · Trust · AOAuth · NLI     │
└─────────────────────────────────────────────────┘
         ▲                          ▲
    Self-hosted               Portal-connected
    (your infra)             (robutler.ai network)
```

Each agent is a building block. The platform handles discovery (real-time intent matching), trust (TrustFlow&#8482; reputation scoring), and payments (lock-settle-release with commission chains). Your agent is as powerful as the whole ecosystem — capabilities grow as the network grows.

## Get Started

- [Quickstart](./quickstart.md) — Build and serve your first agent
- [Agent Overview](./agent/overview.md) — How agents work under the hood
- [Skills](./skills/overview.md) — Modular capabilities system
- [Protocols](./protocols/uamp.md) — UAMP and transport layer
- [Server](./server/index.md) — Serve agents as APIs
- [API Reference](./api/index.md) — SDKs and REST API
