List LLM session records

Read the current user’s session records with page-number pagination.

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/llm/sessions

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5; use the corresponding product API URL for a dedicated deployment.

Configure workspace identity and variables in the same environment.

Request

curl --request GET \
  "$BASE_URL/workspaces/$WORKSPACE_ID/llm/sessions?page=1&page_size=20" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"

If total exceeds 20 and the first page used page_size=20, request the next page as follows:

curl --request GET \
  "$BASE_URL/workspaces/$WORKSPACE_ID/llm/sessions?page=2&page_size=20" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Location

Type

Required

Description

workspace_id

Path

string

Yes

Target workspace, matching X-Workspace-ID.

page

Queries

integer

No

Page number, default 1. Invalid integers use the default; nonpositive values use 1.

page_size

Queries

integer

No

Page size, default 20. Nonpositive values or values above 100 use 20.

source

Queries

string

No

Exact application-source filter after trimming whitespace.

keyword

Queries

string

No

Title keyword filter after trimming whitespace.

tag

Queries

string

No

Filter by session tag name without simultaneously restricting tag source.

Sorts by creation time descending, then ID descending. Keep filters and page_size fixed and increase page until page × page_size >= total. Responses contain only sessions/total and do not return normalized page/page size. Requests do not share a frozen snapshot.

Successful response

{
  "code": 0,
  "data": {
    "sessions": [
      {
        "id": 41,
        "title": "临时会话",
        "source": "moi",
        "user_id": "user-example",
        "config": "{}",
        "created_at": 1794445200,
        "updated_at": 1794445200
      }
    ],
    "total": 1
  }
}

Field

Type

Description

code

integer

0 on success; HTTP status 200.

data.sessions

array (objects)

Session records on this page.

data.total

integer

Total sessions matching the filters.

Error responses

Error formats and read scope describes distinct identity, parameter, resource-read, and storage failure outcomes.

Last updated on