Skip to main content
POST
Text classification
Classify text input into categories with per-class probabilities.

Body

application/json
model
string | null

Routes the request to a specific adapter.

Example:

"(adapter-route)"

input

Input text to classify, encoded as a string or array of strings. To classify multiple inputs in a single request, pass an array of strings.

Either input or tokens field is required.

Example:

"I love programming."

tokens
integer[] | null

The tokenized prompt (i.e., input tokens).

Either input or tokens field is required.

Example:

72

Response

Successfully classified the text input.

data
BaseClassificationData · object[]
required
object
string
required

The object type, which is always set to list.

Allowed value: "list"
usage
TextClassificationUsage · object
required
Last modified on June 9, 2026