session

Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.

get/api/session

Request

  • Base URL
    https://opencode.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://opencode.ai/api/session
  • Auth
    none required

Query parameters

limitstring nullable

Maximum number of sessions to return. Defaults to the newest 50 sessions.

order'asc' | 'desc' nullable

Session order for the first page. Use desc for newest first or asc for oldest first.

searchstring nullable
string
OR
'null'
archived'true' | 'false' nullable
directorystring
projectstring
subpathstring
cursorstring

Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response.

Response

SessionsResponse

Changes