Acontext
SessionSession_idMessages

Get messages from session

GET
/session/{session_id}/messages

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

Authorization

BearerAuth
Authorization<token>

Project Bearer token (e.g., "Bearer sk-ac-xxxx")

In: header

Path Parameters

session_id*string

Session ID

Formatuuid

Query Parameters

limit?integer

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?string

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

with_asset_public_url?boolean

Whether to return asset public url, default is true

format?string

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

Value in"acontext" | "openai" | "anthropic" | "gemini"
time_desc?boolean

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

edit_strategies?string

JSON array of edit strategies to apply before format conversion

pin_editing_strategies_at_message?string

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
  }
}