session

Get session messages

Changed on

Retrieve projected messages for a session, optionally filtered by type. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline, passing the same type filter on each page.

get/api/session/{sessionID}/message

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/{sessionID}/message
  • Auth
    none required

Path parameters

sessionIDstring required

Query parameters

limitstring nullable

Maximum number of messages to return. When omitted, the endpoint returns its default page size.

order'asc' | 'desc' nullable

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

cursorstring nullable

Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.

type'agent-switched' | 'model-switched' | 'location-switched' | 'user' | 'synthetic' | 'system' | 'skill' | 'shell' | 'assistant' | 'compaction' | 'idle' nullable

Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.

Response

SessionMessagesResponse

Changes

    • warning

      removed the optional property ////// from the response with the status

    • info

      added the optional property ////// to the response with the status