Overview

Agent sessions are conversation threads backed by the Gizzi runtime on your data-plane node. The public path is on the Cloud API: it authenticates the Clerk session, resolves your default healthy node, and relays the request to Allternit API. Session rows live in that node’s SQLite, not in Cloud API Postgres. The node translates the session contract (/api/v1/agent-sessions) into the Gizzi runtime contract (/v1/session/*). Sessions support messages, abort, revert/unrevert, compaction, ephemeral incognito chats, and real-time event synchronization via SSE.
HTTP 428 means this account has no healthy paired or provisioned node. Pair a desktop/VPS or start a provisioned instance, then retry.

Base URL

Local data plane (same machine only): http://127.0.0.1:8013/api/v1.

Authentication

All production requests must include a Clerk session JWT in the Authorization header. The Cloud API forwards that header to the node. Gizzi-specific Basic auth is handled internally on the node when GIZZI_PASSWORD / GIZZI_SERVER_PASSWORD is configured.

Session object

Endpoints

List sessions

Returns sessions owned by the caller, filtered and searched on the gateway side. Ephemeral sessions are excluded from the list.

Query parameters

Example request

Example response

Create a session

Creates a new Gizzi session. The gateway stamps the default model, resolves the agent harness config, and records the original surface so it can be restored later.

Request body

Example request

Example response

The surface design is normalized to chat for Gizzi compatibility; the original value is preserved in metadata.originSurface.

Get a session

Example request

Example response

Same shape as the create response.

Update a session

Updates the session title, archived state, permission, or surface.

Request body

Example request

Example response

Same shape as the create response, with active: false.

Delete a session

Deletes the backing Gizzi session and clears any local ephemeral flag.

Example response

204 No Content

List messages

Returns the session’s messages in gateway-normalized form.

Example response

Send a message

Sends a message to the session. role: "user" messages are forwarded to the runtime. role: "assistant" with noReply: true stores a static assistant message without a model turn (a bot’s greeting in its new main chat); it is labelled with metadata.source and stored once per session and source, however many clients post it. Other roles are accepted locally and echoed back immediately.

Request body

Example request

Example response

Same shape as a message from list messages.

Abort a session

Aborts the current turn. For ephemeral sessions, this also hard-deletes the backing session and clears the ephemeral flag.

Example response

Revert a session

Reverts file changes made during the session back to a given message.

Request body

Example response

Same shape as get session.

Unrevert a session

Undoes a prior revert.

Example response

Same shape as get session.

Compact a session

On-demand context condensation via Gizzi’s summarize endpoint.

Example response

Sync sessions (SSE)

Opens a server-sent event stream that forwards Gizzi bus events in a frontend-friendly shape. Supports Last-Event-ID reconnection.

Supported event types

Example curl

Example event

Additional routes

These routes are registered by the same router on the Allternit API node. See the code in cmd/allternit-api/src/agent_session_routes.rs for request shapes.

Error codes