Classification
Classification
Classify text and image datasets using custom labels.
POST
Body
Array of data samples to classify. Each sample contains:
type: Either “text” or “image”value: The content to classify (text string or image URL)
All items in the dataset must be of the same type. You cannot mix text and image samples in a single request.
Array of classification labels. Each label contains:
key: Optional identifier for the label (string or number). Labels sharing the samekeyare 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.
key count as one).Whether to allow multiple labels per classification result. When false, each prediction returns a single label. When true, each prediction can return multiple labels.
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.
Header
Your JigsawStack API key
Response
Indicates whether the call was successful.
Usage information for the API call.
A unique identifier for the request
Array of classification results. Each element corresponds to a dataset sample:
- If
multiple_labelsis false: Each element is a string (single label) - If
multiple_labelsis true: Each element is an array of strings (multiple labels)