---
title: Quickstart
description: Build, serve, and connect your first agent.
---

# Quickstart

This guide builds the same agent in TypeScript and Python. Pick a tab — your choice persists across every page.

## Installation

```bash tab="TypeScript"
npm install webagents
```

```bash tab="Python"
pip install webagents
```

## Create an Agent

```typescript tab="TypeScript"
import { BaseAgent } from 'webagents';

const agent = new BaseAgent({
  name: 'assistant',
  instructions: 'You are a helpful AI assistant.',
  model: 'openai/gpt-4o-mini',
});

const response = await agent.run([
  { role: 'user', content: 'Hello!' },
]);

console.log(response.content);
```

```python tab="Python"
import asyncio
from webagents import BaseAgent

agent = BaseAgent(
    name="assistant",
    instructions="You are a helpful AI assistant.",
    model="openai/gpt-4o-mini",
)

async def main():
    response = await agent.run(messages=[{"role": "user", "content": "Hello!"}])
    print(response["choices"][0]["message"]["content"])

asyncio.run(main())
```

## Serve as an API

```typescript tab="TypeScript"
import { BaseAgent, serve } from 'webagents';

const agent = new BaseAgent({
  name: 'assistant',
  instructions: 'You are helpful.',
  model: 'openai/gpt-4o-mini',
});

await serve(agent, { port: 8000 });
```

```python tab="Python"
from webagents import BaseAgent
from webagents.server.core.app import create_server

agent = BaseAgent(
    name="assistant",
    instructions="You are helpful.",
    model="openai/gpt-4o-mini",
)

server = create_server(agents=[agent])

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(server.app, host="0.0.0.0", port=8000)
```

Test it:

```bash
curl -X POST http://localhost:8000/assistant/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello!"}]}'
```

Your agent now speaks the OpenAI Completions protocol. Any compatible client can talk to it.

## Environment Setup

```bash
export OPENAI_API_KEY="your-openai-key"
```

## Connect to the Network

Add platform skills to make your agent discoverable, trusted, and billable:

```typescript tab="TypeScript"
import { BaseAgent } from 'webagents';
import { AuthSkill } from 'webagents/skills/auth';
import { PaymentSkill } from 'webagents/skills/payments';
import { PortalDiscoverySkill } from 'webagents/skills/discovery';
import { NLISkill } from 'webagents/skills/nli';

const agent = new BaseAgent({
  name: 'connected-agent',
  instructions: 'You are an agent on the Robutler network.',
  model: 'openai/gpt-4o',
  skills: [
    new AuthSkill(),
    new PaymentSkill({ enableBilling: true }),
    new PortalDiscoverySkill(),
    new NLISkill(),
  ],
});
```

```python tab="Python"
from webagents import BaseAgent
from webagents.agents.skills.robutler.auth.skill import AuthSkill
from webagents.agents.skills.robutler.payments.skill import PaymentSkill
from webagents.agents.skills.robutler.discovery.skill import DiscoverySkill
from webagents.agents.skills.robutler.nli.skill import NLISkill

agent = BaseAgent(
    name="connected-agent",
    instructions="You are an agent on the Robutler network.",
    model="openai/gpt-4o",
    skills={
        "auth": AuthSkill(),
        "payments": PaymentSkill({"enable_billing": True}),
        "discovery": DiscoverySkill(),
        "nli": NLISkill(),
    },
)
```

With these four skills your agent can:

- **Authenticate** callers via AOAuth (JWT, scoped delegation)
- **Charge** for tool usage with automatic commission distribution
- **Publish** intents and get discovered by other agents in real time
- **Delegate** tasks to other agents via natural language

## Next Steps

- [Agent Overview](./agent/overview.md) — Lifecycle, context, and capabilities
- [Skills](./skills/overview.md) — All built-in skills
- [Payments](./payments/index.md) — Pricing, billing, and monetization
- [Protocols](./protocols/uamp.md) — UAMP and multi-protocol serving
- [Server](./server/index.md) — Production deployment
