Go to file
Levi Neely e88940df19 readme: document HTTP gateway API 2026-07-18 22:39:41 +02:00
.gitignore gitignore 2026-04-24 18:30:59 +02:00
Makefile add GNU Makefile mirroring mkfile 2026-06-16 06:50:35 +02:00
README.md readme: document HTTP gateway API 2026-07-18 22:39:41 +02:00
dbus.go fix: rename session after creation when name is provided 2026-07-07 12:39:55 +02:00
go.mod httpgw: remove 9P backend, D-Bus only 2026-07-18 21:36:16 +02:00
go.sum httpgw: remove 9P backend, D-Bus only 2026-07-18 21:36:16 +02:00
main.go httpgw: remove 9P backend, D-Bus only 2026-07-18 21:36:16 +02:00
mkfile initial httpgw: HTTP gateway for 9P file operations 2026-04-24 17:45:00 +02:00
openapi.json update httpgw: add dbus and ninep support 2026-07-06 18:22:38 +02:00

README.md

ollie-httpgw

HTTP gateway for ollie. Translates REST requests to D-Bus calls against org.ollie.SessionManager, allowing any HTTP client to manage sessions without a D-Bus library. Also serves as the backend for the web UI.

Building

mk

Installs ollie-httpgw to $HOME/bin.

Usage

ollie-httpgw start       # start daemon (backgrounds itself)
ollie-httpgw fgstart     # start in foreground
ollie-httpgw stop        # stop daemon
ollie-httpgw status      # check if running

The gateway listens on :8011 by default. Override with -listen:

ollie-httpgw start -listen :9090

Requires either olliesrv or ollie-dbus running (provides the D-Bus service).

API

All responses are JSON. An OpenAPI spec is served at GET /openapi.json.

Sessions

Method Path Action
GET /sessions List all sessions
POST /sessions Create a session (body: {cwd, backend, model, agent})
GET /sessions/{id} Get session info
DELETE /sessions/{id} Kill a session
PATCH /sessions/{id} Rename a session (body: {name})

Interaction

Method Path Action
POST /sessions/{id}/submit Submit a prompt (body: {prompt})
POST /sessions/{id}/interrupt Interrupt the current turn

State queries

Method Path Action
GET /sessions/{id}/state Get session state
GET /sessions/{id}/chat?offset=N Get chat text from offset
GET /sessions/{id}/usage Get token usage
GET /sessions/{id}/cost Get cost
GET /sessions/{id}/config Get config
POST /sessions/{id}/config Set config (body: {key, value})
GET /sessions/{id}/context Get message history (JSONL)
GET /sessions/{id}/models List models for session's backend

Peers

Method Path Action
GET /sessions/{id}/peers List peers
POST /sessions/{id}/peers Add peer (body: {peer_id})
DELETE /sessions/{id}/peers/{peer_id} Remove peer
POST /sessions/{id}/peers/{peer_id}/submit Submit to peer (body: {prompt})

Enumeration

Method Path Action
GET /backends List available backends
GET /agents List available agents

Example

# Create a session
curl -X POST http://localhost:8011/sessions \
  -d '{"cwd": "/home/user/project", "agent": "default"}'

# Submit a prompt
curl -X POST http://localhost:8011/sessions/<id>/submit \
  -d '{"prompt": "list files in cwd"}'

# Poll chat
curl http://localhost:8011/sessions/<id>/chat?offset=0