---
title: "Generate conversation title"
method: POST
path: "/chat/conversations/{id}/generate-title"
---

# Generate conversation title

`POST /chat/conversations/{id}/generate-title`

## Request

- Base URL: `https://api.closedloop.sh`
- URL: `https://api.closedloop.sh/chat/conversations/{id}/generate-title`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/closedloop/apis/closedloop-ai-api/docs/chat/conversations/:id/generate-title/post.ts> (a function with typed inputs; its response is checked against the schema)

Generate a title for a conversation based on the first message

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `firstMessage` string, required: The first message in the conversation

## Response `200`

Title generated successfully

- object
  - `title` string

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `404`: Resource not found
- `500`: Internal server error

---

[API](https://skmtc.dev/closedloop/apis/closedloop-ai-api.md) - [All operations](https://skmtc.dev/closedloop/apis/closedloop-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/closedloop/apis/closedloop-ai-api/revisions/20e04ae722ee?raw)
