> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建对话会话 - POST /v1/workspaces/:workspace_id/chat-sessions

> 通过 POST /v1/workspaces/:workspace_id/chat-sessions 创建一次对话会话。最小角色 contributor。

创建一个对话会话（Chat Session）。会话用于承载多轮消息，并作为分层对话记忆（L0–L3）的提炼来源。

## 接口

```http theme={null}
POST /v1/workspaces/:workspace_id/chat-sessions
```

## 认证

`Authorization: Bearer <jwt>` 或 `X-API-Key <sk_...>`。最小角色：**contributor**。

## 路径参数

<ParamField path="workspace_id" type="string" required>
  工作空间 id。
</ParamField>

## 请求体

<ParamField body="title" type="string">
  会话标题，省略时由服务端决定。
</ParamField>

## 响应

<ResponseField name="id" type="string">
  会话 id（`sess_...`）。
</ResponseField>

<ResponseField name="workspace_id" type="string">
  所属工作空间 id。
</ResponseField>

<ResponseField name="owner_id" type="string">
  拥有者用户 id。
</ResponseField>

<ResponseField name="title" type="string">
  标题。
</ResponseField>

<ResponseField name="created_at" type="string">
  创建时间（RFC3339）。
</ResponseField>

<ResponseField name="updated_at" type="string">
  更新时间（RFC3339）。
</ResponseField>

## 示例

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://memo.ariacompute.cn/v1/workspaces/ws_01a2b3c4d5e6/chat-sessions \
    -H "Authorization: Bearer <jwt>" \
    -H "Content-Type: application/json" \
    -d '{"title":"产品咨询"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "sess_01a2b3c4d5e6",
    "workspace_id": "ws_01a2b3c4d5e6",
    "owner_id": "usr_01a2b3c4d5e6",
    "title": "产品咨询",
    "created_at": "2026-10-12T09:00:00Z",
    "updated_at": "2026-10-12T09:00:00Z"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.