Get messages from session
Get messages from session. Default format is openai. Can convert to acontext (original), anthropic, or gemini format.
Authorization
BearerAuth Project Bearer token (e.g., "Bearer sk-ac-xxxx")
In: header
Path Parameters
Session ID
uuidQuery Parameters
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.
Cursor for pagination. Use the cursor from the previous response to get the next page.
Whether to return asset public url, default is true
Format to convert messages to: acontext (original), openai (default), anthropic, gemini.
"acontext" | "openai" | "anthropic" | "gemini"Order by created_at descending if true, ascending if false (default false)
JSON array of edit strategies to apply before format conversion
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 Body
application/json
curl -X GET "https://loading/api/v1/session/497f6eca-6276-4993-bfeb-53cbbbba6f08/messages"{
"code": 0,
"error": "string",
"msg": "string",
"data": {
"edit_at_message_id": "string",
"has_more": true,
"ids": [
"string"
],
"items": {},
"metas": [
{}
],
"next_cursor": "string",
"public_urls": {
"property1": {
"expire_at": "string",
"url": "string"
},
"property2": {
"expire_at": "string",
"url": "string"
}
},
"this_time_tokens": 0
}
}Flush session POST
Flush the session buffer for a given session
Store message to session POST
Supports JSON and multipart/form-data. In multipart mode: the payload is a JSON string placed in a form field. The format parameter indicates the format of the input message (default: openai, same as GET). The blob field should be a complete message object: for openai, use OpenAI ChatCompletionMessageParam format (with role and content); for anthropic, use Anthropic MessageParam format (with role and content); for acontext (internal), use {role, parts} format. The optional meta field allows attaching user-provided metadata to the message, which can be retrieved via get_messages().metas or updated via patch_message_meta().