---
title: "Classify"
method: POST
path: "/classify"
---

# Classify

`POST /classify`

Score text against a set of user-defined labels and return a softmax-normalised probability distribution.

## Request body

- object
  - `text` string, required — The text to classify.
  - `labels` object[], required — One or more label definitions. Must contain at least one item.
    - `name` string, required — Short identifier for the label (e.g. "medical", "billing"). Used as the key in the scores response object.
    - `rubric` string, required — A yes/no question the model uses to score the label. Phrased so that a "yes" answer means the label applies.

## Response `200`

Successful classification

- object
  - `top_label` string — Name of the highest-scoring label.
  - `scores` object — Map of label name to probability score. All values sum to 1.0.
  - `labels` object[] — Full label list with name, score, and rubric, in the same order as the request.
    - `label` string
    - `score` number
    - `rubric` string

## Other responses

- `422` — Malformed request body or empty labels array.
- `502` — Model service unavailable or returned an error.

---

[API](https://skmtc.dev/scaledown/apis/scaledown-api.md) · [All operations](https://skmtc.dev/scaledown/apis/scaledown-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scaledown/scaledown-api/revisions/4289049c3ecd/schema)
