Skip to main content
A session is one conversation on an instance. An instance holds many sessions, one per thread, and each session keeps its own full history, so you only ever send the new input. These endpoints are served by the gateway running inside the instance. Everything on this page lives on the instance URL, not the hosting API: the base is https://{instanceId}.agent37.app, with the same Authorization: Bearer sk_live_... header. The platform edge authenticates the key and checks the instance belongs to your workspace, then the gateway answers. See Instance URLs.
ActionEndpoint
List sessionsGET /v1/sessions
Retrieve, with historyGET /v1/sessions/{id}
DeleteDELETE /v1/sessions/{id}
List modelsGET /v1/models
Health and versionGET /v1/health · GET /v1/version
You never create a session directly. The first POST /v1/responses without a session_id mints one and returns its id; reuse that id to continue the thread.

The session object

id
string
The session id: 32 hex characters, no prefix. Every response in the conversation carries it as session_id.
agent
string
The agent the session runs. hermes today.
model
string | null
The session’s current model. Sending model on a turn updates it; null until a turn sets one.
provider
string | null
The current model’s provider, e.g. anthropic.
created
number
When the session started, in epoch milliseconds.
last_response_at
number | null
When the last turn finished, in epoch milliseconds. Failed turns do not update it; null until the first turn completes.
Gateway timestamps are epoch milliseconds. The hosting API at api.agent37.com uses epoch seconds.

List sessions

GET /v1/sessions returns every session on the instance, newest first, wrapped in { "data": [...] }. The list carries session metadata only, never history, so it stays cheap to poll for a sidebar.
curl https://ab12cd34ef.agent37.app/v1/sessions \
  -H "Authorization: Bearer sk_live_..."

Retrieve a session with history

GET /v1/sessions/{id} returns the session object plus history: the full transcript, in order. You read it for display or audit; you never resend it, because the session already holds it. A session with no completed turns returns history: []. An unknown id returns 404 session_not_found. Each entry in history is a message:
id
string
The message id. Treat it as opaque; it uses a different format from session and response ids.
session_id
string
The session the message belongs to.
role
string
user, assistant, or system.
content
string
The message text.
thinking
string
The assistant’s reasoning for that turn, when the agent recorded any. Absent otherwise.
created_at
number
When the message was created, in epoch milliseconds.
curl https://ab12cd34ef.agent37.app/v1/sessions/7f3e0b6c52a949d2b1c4a8e9d0f31726 \
  -H "Authorization: Bearer sk_live_..."

Delete a session

DELETE /v1/sessions/{id} removes the conversation and returns exactly { "id": "...", "deleted": true }. The delete acts once: repeating it returns 404 session_not_found.
curl -X DELETE https://ab12cd34ef.agent37.app/v1/sessions/7f3e0b6c52a949d2b1c4a8e9d0f31726 \
  -H "Authorization: Bearer sk_live_..."
Deleting a session is permanent. It removes the conversation and its history, but leaves the instance (its files, memory, and connected accounts) untouched.

One turn at a time

A session runs one response at a time. Posting new input while a turn is in flight returns 409 session_busy. Cancel the running turn with POST /v1/responses/{id}/cancel, or start the new input on another session. Two sessions on the same instance run independently.

List models

GET /v1/models lists the models the instance’s agent can run. The result is cached for about 60 seconds, so a newly available model can take up to a minute to appear.
default_model
string | null
The model used when a turn does not name one.
default_provider
string | null
The provider of the default model.
data
array
One entry per model: { "id", "label", "provider", "is_default" }. Pass an entry’s id as model (with its provider) on a turn.
curl https://ab12cd34ef.agent37.app/v1/models \
  -H "Authorization: Bearer sk_live_..."
model and provider are dials you set per turn on POST /v1/responses: omit them to keep the session’s current model, or send them to switch. A continuation that sets them updates the session’s stored model and provider for the turns that follow.

Health and version

GET /v1/health returns { "ok": true, "hermes": true }. ok is true whenever the gateway is up; hermes reports whether the agent worker behind it is reachable. Use it as a readiness probe after create or start. GET /v1/version returns the gateway build, e.g. { "name": "agent37-gateway", "version": "0.1.0" }.

Next steps

Send a message

Start and continue sessions with POST /v1/responses, the turn that fills these threads.

Streaming

The full SSE event list for stream: true, plus reconnect and cancel.

Build a chat app

Put list, send, and continue together: one instance per user, one session per thread.

Instance URLs

How {instanceId}.agent37.app routing and authentication work.