---
title: "Generate session title using AI"
method: POST
path: "/api/sessions/{session_id}/generate-title"
tags: ["sessions"]
---

# Generate session title using AI

`POST /api/sessions/{session_id}/generate-title`

Generate a concise session title using AI based on the first conversation turn.

If request body is empty or parameters are missing, the backend will
automatically read the first turn from wire.jsonl.

## Path parameters

- `session_id` string, uuid, required

## Request body

- GenerateTitleRequest — Generate title request. Parameters are optional - if not provided, the backend will read from wire.jsonl automatically.
  - `user_message` string, nullable
  - `assistant_response` string, nullable

## Response `200`

Successful Response

- GenerateTitleResponse — Generate title response.
  - `title` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface.md) · [All operations](https://skmtc.dev/moonshotai/apis/kimi-code-cli-web-interface/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/moonshotai/kimi-code-cli-web-interface/revisions/8eac348b2e66/schema)
