Web chat and HTTP API

The HTTP server presents two faces of the same system: web chat for people and an API for authorised clients. Both pass through the same identity, ownership, and capacity controls. Knowing a URL or identifier does not grant access to another user's data.

On this page

  1. Opening Metnos in a browser
  2. First and later access
  3. What the server contains
  4. Main route families
  5. Identity and authorisation
  6. Direct and resumable turns
  7. One chat across several devices
  8. Network boundaries
  9. Checking the service

Opening Metnos in a browser

The default web-chat port is 8770. On the computer hosting Metnos, open:

http://127.0.0.1:8770/

If you allowed local-network access during installation, you can use the server's private address from a phone or another computer on the same network. For example:

http://192.168.1.33:8770/

The address is only an example. At the end of installation, Metnos prints the addresses it actually detected and stores the base URLs in ~/.local/share/metnos/install_summary.md. The user page is /admin/users; /amin/users contains a typo and correctly returns 404.

During installation phase 4, you can restrict the interface to a browser running on the server itself. Metnos then listens only on 127.0.0.1, and LAN URLs do not work. The interactive installer offers LAN access by default; starting the HTTP process by itself takes the more conservative local-only default unless explicitly configured.

First and later access

At the end of installation, Metnos also prints one or more complete administrator links. Each contains a single-use code valid for 15 minutes. Opening one establishes the browser's administrator session and takes you to Settings. These complete links are not stored in the installation summary; that file keeps only the base URLs.

If the link has expired or has already been used, open /admin/login and enter the administrator key created during installation. Do not share either the one-time link or the key.

A browser paired with an ordinary user receives a separate cookie. It can use chat and the surfaces admitted for that role, but it does not become an administrator. To create users and pair browsers, see Pairing and identity.

“Administrator role required.” This means the URL exists, but the current browser lacks a valid administrator session. Open /admin/login; changing the URL does not bypass the check.

What the server contains

Metnos builds one aiohttp application and connects four groups of functions to it:

GroupResponsibility
AgentChat, turns, sessions, dialogues, attachments, web pairing, and OAuth callbacks.
Durable workloadsWork that survives the connection, persistent events, and controlled artifact downloads.
AdministrationSettings: models, services, users, devices, executors, activity, and safety.
Combined statusA joint check of the server, catalog, and adjacent browser service.

A request body may be up to 50 MiB to accommodate reference images. Turns that run Python work pass through a bounded worker pool with a global queue and a per-caller limit. When capacity is unavailable, the server reports that fact and tells the caller when to retry.

Two services remain separate. The remote-executor protocol normally uses 127.0.0.1:8765; the browser-control component normally uses 127.0.0.1:8771. These are not alternative chat ports and should not be exposed as user interfaces.

Main route families

FamilyExamplesPurpose
Chat and status/, /agent/health, /.well-known/metnos.jsonInterface, liveness, and a minimal node description.
Turns/agent/turn, /agent/turn/submit, /agent/turns/{id}Submission, event stream, status, history, feedback, and retry.
Sessions and dialogues/agent/session/*, /agent/dialog/{id}/*Single-browser writing and structured input collection.
Attachments/agent/gallery/{turn_id}, /agent/photos/*User-owned galleries, signed image links, and a protected web proxy.
Durable workloads/agent/workloads, /agent/workloads/{id}/*Status, units, persistent events, and artifacts for long-running work.
Administration/admin/users, /admin/devices, /admin/virt, /admin/servicesConfiguration and controls reserved for administrators.

The route registries in code remain authoritative. This table explains the shape without promising an immutable endpoint list.

Identity and authorisation

Before calling a function, the server classifies the request as anonymous, user, or admin.

An invalid Bearer token never falls through to optional LAN trust. Proxy headers are considered only when the TCP connection comes from an explicitly trusted proxy; a client cannot make itself local by writing X-Forwarded-For.

The administrator cookie lasts up to seven days and the user cookie up to ninety. Both are HttpOnly. The Secure option is applied when the browser reaches Metnos over HTTPS; the administrator uses the stricter SameSite policy.

Direct and resumable turns

Direct turn

POST /agent/turn accepts JSON or multipart data containing text and images. It can return one JSON document or send SSE events as the turn progresses. If the connection breaks, this route alone does not provide the same reconnection behaviour as the decoupled path.

Resumable turn

POST /agent/turn/submit reserves capacity and returns 202 with a turn_id. Work continues if the page is refreshed. The browser can reconnect to the stream, resume after the last event it saw, or poll persisted status.

Stream, status, history, gallery, feedback, and retry always check ownership. Guessing a turn_id does not allow somebody to read or repeat another user's turn.

One chat across several devices

Only one browser may write for each user-and-web-channel pair at a time. If a second browser opens the same chat, Metnos can cancel, make the new session active, or continue the previous conversation on the new device. Transfer atomically revokes the old browser's write access.

The conversation belongs to the user, not the device. This prevents a phone and laptop from creating two concurrent branches while pretending to be the same session. Details are in Pairing and identity.

Network boundaries

Checking the service

curl -fsS http://127.0.0.1:8770/agent/health
curl -fsS http://127.0.0.1:8770/.well-known/metnos.json
curl -fsS -H "Authorization: Bearer <administrator-key>" \
  http://127.0.0.1:8770/agent/stack/health

The first request proves only that the process responds. The last one is administrator-only and also checks the catalog and browser-service contract, making it the more useful probe before a full test.

For message transport, continue with Conversation channels. For who may enter and under which identity, see Pairing and identity.