Skip to main content
POST

Body

array
required
Array of data samples to classify. Each sample contains:
  • type: Either “text” or “image”
  • value: The content to classify (text string or image URL)
Maximum of 32 samples allowed per request. At least 1 sample required.
All items in the dataset must be of the same type. You cannot mix text and image samples in a single request.
array
required
Array of classification labels. Each label contains:
  • key: Optional identifier for the label (string or number). Labels sharing the same key are merged into a single combined label, so you can attach multiple text descriptions and/or example images to the same class.
  • type: Either “text” or “image”
  • value: The label content (text string or image URL)
  • text: Optional text description for an image label, used to give the model extra context about what the image represents.
Maximum of 24 labels allowed per request. At least 2 distinct labels required (labels merged by key count as one).
boolean
default:"false"
Whether to allow multiple labels per classification result. When false, each prediction returns a single label. When true, each prediction can return multiple labels.
string
Optional natural-language instruction that describes the classification task (e.g. “Classify the sentiment of the following reviews”). When provided, it is prepended to the prompt to steer the model.
string
required
Your JigsawStack API key

Response

boolean
Indicates whether the call was successful.
object
Usage information for the API call.
string
A unique identifier for the request
array[string | string[]]
Array of classification results. Each element corresponds to a dataset sample:
  • If multiple_labels is false: Each element is a string (single label)
  • If multiple_labels is true: Each element is an array of strings (multiple labels)