v1

latestSwagger 2.02026-07-176862225.3 KB
session

Get messages from session

Get messages from session. Default format is openai. Can convert to acontext (original), anthropic, or gemini format.

get/session/{session_id}/messages

Path parameters

session_idstring uuid required

Session ID

Query parameters

limitinteger

Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned.

WARNING! Use limit only for read-only/display purposes (pagination, viewing). Do NOT use limit to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the token_limit edit strategy in edit_strategies parameter to safely manage message context size.

cursorstring

Cursor for pagination. Use the cursor from the previous response to get the next page.

with_asset_public_urlboolean

Whether to return asset public url, default is true

with_eventsboolean

Whether to include session events in the response, default is false

format'acontext' | 'openai' | 'anthropic' | 'gemini'

Format to convert messages to: acontext (original), openai (default), anthropic, gemini.

time_descboolean

Order by created_at descending if true, ascending if false (default false)

edit_strategiesstring

JSON array of edit strategies to apply before format conversion

pin_editing_strategies_at_messagestring

Message ID to pin editing strategies at. When provided, strategies are only applied to messages up to and including this message ID, keeping subsequent messages unchanged. This helps maintain prompt cache stability by preserving a stable prefix. The response will include edit_at_message_id indicating where strategies were applied.

Response

OK

codeinteger
errorstring
msgstring