Docs/New session
API reference

New session

POST /v1/agents/new-session

Starts a fresh conversation on a computer. The next message has no memory of earlier ones.

Request

Start a new session
curl -s "$SAI_API_URL/v1/agents/new-session" \
  -H "Authorization: Bearer $SAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machineId": "m_7f2a",
    "channel": "api"
  }'
FieldRequiredNotes
machineIdyesThe computer whose API conversation (for this API key) to rotate.
channelnoapi or cli. Omitted, it is api for an API key or a Tenant token, cli for a signed-in session.

Response

200 OK · New sessionJSON
{ "sessionId": "cs_02KQA" }

The next POST /message with the same API key on this computer lands in this session. Other keys' conversations are not touched.

Errors

StatusBody
404{ "error": "Machine not found." }
429More than 200 new sessions in an hour (20 on the free plan).

Gotchas

  • The sai CLI sends channel: "cli" to rotate its own conversation; an API caller can omit it.
  • You rarely need this. One long conversation per key and computer is the normal shape; rotate when a new task should not see the old context.
  • A running task is not stopped by a new session. Call /abort first if you want it stopped.
© 2026 Simular Inc. All rights reserved.