For the complete documentation index, see llms.txt. This page is also available as Markdown.

v1/classify-file

Classify the contents of an uploaded file. Accepts text, JSON, columnar (CSV, Excel), image, PDF, SVG, and code files. To classify a text string directly, use v1/classify.

Request

The request must be multipart/form-data with two parts:

Part
Type
Description

file

file

The file to classify. Required.

content

string

JSON object with filter options. Required (send {} to apply no filters).

content filter options

Only filters is supported in the content part. The full set of body options available on v1/classify is not available for file uploads.

Field
Type
Description

filters

string[]

Allow-list of element labels to report. Omit or pass an empty array to report every supported element.

Limits

Limit
Value

Multipart form size

32 MB

Text file content

500 KB

Text files larger than 500 KB are truncated to the first 500 KB before classification. The multipart form limit applies to the entire request including the file.


Response

The response shape depends on the file type:

  • Text, SVG, parseable files — array of Classification objects. Each object has the same fields as described in the v1/classify response.

  • JSON files — a JSON-specific classification structure. Falls back to the text path only if JSON parsing fails.

  • Columnar files (CSV, Excel, Parquet) — columnar structure grouped by column.

  • Image files — array of image classification objects with bounding-box coordinates.

  • PDF files — array of per-page classification objects.

  • Code files — array of code classification objects with line and column offsets. The filters field in content is not applied to code files.

If the file type cannot be determined, the endpoint returns an empty 200 response.


Last updated

Was this helpful?