Overview

Agent sessions are conversation threads backed by the Gizzi runtime. The Agent Sessions API translates the frontend session contract (/api/agent-sessions) into the Gizzi runtime contract (/v1/session/*), so the Rust API remains a thin gateway rather than a competing session database. Sessions support messages, abort, revert/unrevert, compaction, ephemeral incognito chats, and real-time event synchronization via SSE.

Base URL

Authentication

All requests must include a valid bearer token in the Authorization header. Gizzi-specific Basic auth is handled internally by the gateway 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. Only role: "user" messages are forwarded to the runtime; 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

Error codes