<span id="读取-llm-会话详情"></span>

# Get LLM session details

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read one session record for the current user.


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

<span id="调用前准备"></span>

## 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](objects.md#request-prerequisites). Obtain session_id from the session list.

<span id="请求"></span>

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --request GET \
  "$BASE_URL/workspaces/$WORKSPACE_ID/llm/sessions/$SESSION_ID" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"
```

:::::
:::::{tab-item} Parameters

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | Path | string | Yes | Target workspace, matching X-Workspace-ID. |
| `session_id` | Path | integer | Yes | Positive integer ID returned by this service. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 0,
  "data": {
    "id": 41,
    "title": "临时会话",
    "source": "moi",
    "user_id": "user-example",
    "config": "{}",
    "created_at": 1794445200,
    "updated_at": 1794445200
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success; HTTP status 200. |
| `data` | object | [Session record](objects.md#session-object). |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

[Error formats and read scope](objects.md#error-contract) describes distinct identity, parameter, resource-read, and storage failure outcomes.
