AI
Classification
Classify text or images against a custom label set.
POST/v1/ai/classification
Classify a batch of text or image inputs against your own label taxonomy. Use
multiple_labels: true to allow more than one label per input.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dataset | object[] | yes | Items to classify, 1–32. Each { type: "text" | "image", value: string }. |
labels | object[] | yes | Label set, 2–24 distinct labels. Each { type, value, key?, text? }. |
multiple_labels | boolean | no | Allow multiple labels per input. Defaults to false. |
task | string | no | Natural-language instruction to steer the model. |
Request
curl https://api.marob.ai/v1/ai/classification \
-H "Authorization: Bearer $MAROB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dataset": [
{ "type": "text", "value": "This charger stopped working after a week — total waste of money." }
],
"labels": [
{ "type": "text", "value": "complaint" },
{ "type": "text", "value": "compliment" },
{ "type": "text", "value": "question" }
]
}'Response
{
"success": true,
"_usage": {
"input_tokens": 60,
"output_tokens": 12,
"inference_time_tokens": 180,
"total_tokens": 252
},
"log_id": "log_01JABC...",
"predictions": ["complaint"]
}If multiple_labels is true, predictions is an array of arrays —
one inner array per input item, matching the input order.