# Get a bot's summary

Source: https://langbot.ai/docs/api/monitoring/get-summary

`GET /v1/bots/{bot_id}/summary`

Realized and marked P&L, fees, fills, open positions, max drawdown, last heartbeat and status for one bot.

**Auth.** An account token (`Authorization: Bearer lb_…`) or a signed-in web session. A report-only token (`lbr_…`) is refused here with `403 scope_denied`.

**Limits.** Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

## Parameters

### Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `bot_id` | string | yes | The bot id (`bot_…`). |

## Request

**curl**

```bash
curl "https://api.langbot.ai/v1/bots/bot_01M6G72RFQRQ8JGNG8T1447GGP/summary" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"
```

**Python**

```python
from langbot import LangbotClient

async with LangbotClient() as lb:  # reads LANGBOT_API_TOKEN
    s = await lb.bots.summary("bot_01M6G72RFQRQ8JGNG8T1447GGP")
    print(s["status"], s["pnl"]["marked_net"], s["max_drawdown"])
```

**TypeScript**

```ts
import { LangbotClient } from "@langbotai/sdk";

const lb = new LangbotClient(); // reads LANGBOT_API_TOKEN
const s = await lb.bots.summary("bot_01M6G72RFQRQ8JGNG8T1447GGP");
console.log(s.pnl.marked_net);
```

## Response

`200 OK`

```json
{
  "bot_id": "bot_01M6G72RFQRQ8JGNG8T1447GGP",
  "as_of": 1793693150709,
  "status": "ok",
  "status_reason": "last heartbeat 4 s ago",
  "last_event_at": 1793693146653,
  "last_heartbeat_at": 1793693146653,
  "halted_at": null,
  "halt_reason": null,
  "pnl": {
    "realized": 0.7,
    "fees": 0.15,
    "realized_net": 0.55,
    "unrealized": 1.4,
    "marked_net": 1.95,
    "today_net": 0.55
  },
  "fills": 2,
  "contracts": 20.0,
  "volume_usd": 8.9,
  "open_positions": 1,
  "positions_truncated": false,
  "max_drawdown": 0.0,
  "marks": {
    "settled": 0,
    "last_trade": 0,
    "last_fill": 1,
    "none": 0
  },
  "sources": {
    "client": 2,
    "chain": 0
  },
  "retention_days": 90,
  "test_run_id": null,
  "pending_fills": 0
}
```

P&L is per market in Yes terms with average cost: buying No at p counts as selling Yes at 1 − p. `realized_net` = realized − fees; open positions are marked at the settled result, else the last recorded trade, else the bot's last fill (`marks` counts each). `today_net` is realized net since 00:00 UTC plus the change in marked P&L since then. `max_drawdown` is the largest fall of hourly cumulative realized net from its peak within retention. `pending_fills` are fills received in the last 2 seconds, applied on the next read. These are measurements of what your bot reported, not advice.

## Errors

| Status | `code` | When |
|---|---|---|
| 404 | `not_found` | No bot with that id on your account (or it was deleted). |
| 401 | `auth_required` | No token was sent. |
| 401 | `token_invalid` | The token was not recognised (mistyped, revoked or expired). |
| 422 | `validation_error` | A parameter failed validation; `detail[].loc` names it. |
| 429 | `rate_limited` | Over your request budget; wait `Retry-After` seconds. |

Every error body is `{"detail": …, "code": "…"}`; branch on `code`. All codes: [Errors](https://langbot.ai/docs/api#errors).
