Classify a document into one of the provided categories.
This endpoint analyzes a document and classifies it into exactly one of the user-defined categories, returning the classification with chain-of-thought reasoning explaining the decision.
Example use cases:
The document to classify
The categories to classify the document into
The model to use for classification
Only use the first N pages of the document for classification. Useful for large documents where classification can be determined from early pages.
Additional context for classification (e.g., iteration context from a loop)
Number of classification runs to use for consensus voting. Uses deterministic single-pass when set to 1.
1 <= x <= 8If true, skip the LLM cache and force a fresh completion
Successful Response
The classification result with reasoning
Usage information for the classification
Likelihood score (0.0-1.0) of the consensus classification. Only set when n_consensus > 1 and at least two votes succeed.
Individual LLM votes used to build the consensus. Empty when n_consensus <= 1.