---
title: "API Overview"
description: "HTTP API for building on top of ntrp."
---

## Base URL

```
http://localhost:6877
```

Configure with `NTRP_HOST` and `NTRP_PORT`.

## Authentication

All endpoints except `/health` require a Bearer token:

```bash
curl http://localhost:6877/session \
  -H "Authorization: Bearer YOUR_API_KEY"
```

See [Authentication](/api-reference/authentication) for details.

## Response format

All endpoints return JSON. The event stream (`GET /chat/events/{session_id}`) uses Server-Sent Events (SSE).

## Endpoints

| Group | Endpoints | Description |
|-------|-----------|-------------|
| [Chat](/api-reference/chat) | `GET /chat/events`, `POST /chat/message`, `POST /chat/background`, `POST /cancel` | SSE stream, messaging, background mode |
| [Sessions](/api-reference/sessions) | `/session*`, `/sessions*` | Session management |
| [Memory](/api-reference/memory) | `/facts*`, `/observations*`, `/dreams*` | Memory CRUD |
| [Automations](/api-reference/automations) | `/automations*`, `/notifiers*` | Scheduled tasks, notifier configs |
| [Config](/api-reference/config) | `/config*`, `/models*`, `/providers*`, `/services*`, `/directives` | Configuration, providers, models |
| Health | `GET /health` | Server status (public) |

## Health check

```bash
curl http://localhost:6877/health
```

```json
{
  "status": "ok",
  "version": "0.15.0"
}
```

Pass a Bearer token to also verify authentication:

```json
{
  "status": "ok",
  "version": "0.15.0",
  "auth": true
}
```
