---
title: "Clusters temáticos (k-means sobre embeddings)"
method: GET
path: "/api/v1/clusters"
tags: ["Busca"]
---

# Clusters temáticos (k-means sobre embeddings)

`GET /api/v1/clusters`

## Request

- Base URL: `https://api.ragjur.ai`
- URL: `https://api.ragjur.ai/api/v1/clusters`
- Auth: one of:
  - API key in header `x-api-key`
  - OAuth 2 (authorization code, authorization URL `https://mcp.ragjur.ai/oauth/authorize`, token URL `https://mcp.ragjur.ai/oauth/token`, scopes: `ragjur:read`)

Agrupa uma amostra de decisões do tema em sub-temas. Latência 10–60 s. Requer serviço de embeddings.

## Query parameters

- `busca` string, required
- `fonte` string
- `tribunal` string
- `turma` string
- `clusters` integer
- `amostra` integer

## Response `200`

Clusters

- object
  - `fonte` string
  - `busca` string
  - `total_documentos` integer
  - `total_base` integer
  - `num_clusters` integer
  - `clusters` object[]
    - `id` integer
    - `label` string
    - `tamanho` integer
    - `documentos` object[]
      - `numero_processo` string
      - `relator` string
      - `orgao_julgador` string
      - `ementa_resumo` string
      - `classificacao` string
    - `distribuicao_direcional` object
      - `favoravel` integer
      - `desfavoravel` integer
      - `incidental` integer
  - `modelo_embedding` string
  - `provedor_embedding` string

## Other responses

- `400`: Parâmetro obrigatório ausente ou inválido
- `401`: Sem `x-api-key` ou chave inválida
- `403`: Chave desativada
- `429`: Rate limit excedido (janela deslizante por chave). Ver `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`.
- `500`: Erro interno

---

[API](https://skmtc.dev/ragjur/apis/ragjur-api.md) · [All operations](https://skmtc.dev/ragjur/apis/ragjur-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ragjur/apis/ragjur-api/revisions/448e3f75cc15?raw)
