Marob AI
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

NameTypeRequiredDescription
datasetobject[]yesItems to classify, 1–32. Each { type: "text" | "image", value: string }.
labelsobject[]yesLabel set, 2–24 distinct labels. Each { type, value, key?, text? }.
multiple_labelsbooleannoAllow multiple labels per input. Defaults to false.
taskstringnoNatural-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.

On this page