---
title: "Compute new clusters"
method: POST
path: "/ai/clusters"
tags: ["Clusters"]
---

# Compute new clusters

`POST /ai/clusters`

Starts a background task to compute how the data in an [embedded storage bucket](https://developers.telnyx.com/api-reference/embeddings/embed-documents) is clustered. This helps identify common themes and patterns in the data.

## Request body

- PublicTextClusteringRequest
  - `bucket` string, required — The embedded storage bucket to compute the clusters from. The bucket must already be [embedded](https://developers.telnyx.com/api-reference/embeddings/embed-documents).
  - `prefix` string — Prefix to filter whcih files in the buckets are included.
  - `files` string[] — Array of files to filter which are included.
  - `min_cluster_size` integer — Smallest number of related text chunks to qualify as a cluster. Top-level clusters should be thought of as identifying broad themes in your data.
  - `min_subcluster_size` integer — Smallest number of related text chunks to qualify as a sub-cluster. Sub-clusters should be thought of as identifying more specific topics within a broader theme.

## Response `200`

Successful Response

- TextClusteringResponseData
  - `data` TextClusteringResponse, required
    - `task_id` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/team-telnyx/apis/telnyx-api.md) · [All operations](https://skmtc.net/team-telnyx/apis/telnyx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api/revisions/e32d46c5945b/schema)
