# Delete an LLM session record

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

Delete a specified session record for the current user.


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

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Configure Workspace identity and variables in the same environment](objects.md#request-prerequisites). Confirm the target session and retain records you still need.

## Request

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

```bash
curl --request DELETE \
  "$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. |

Success returns an empty response. Confirm removal through lists or details afterward. This does not establish cascading cleanup of messages, tag relationships, files, or Provider sessions. Repeated deletion may return 404.

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

## Successful response

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

```http
HTTP/1.1 204 No Content
```

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

HTTP 204 with no body. This operation returns no JSON data object.

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

## Error responses

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