Skip to main content
The parser detects the file kind, extracts the text, and places it in the model’s context before the model runs. Attach a file part to a chat message to parse and run inference together. For text extraction alone, upload a document to POST /api/v1/attachments/parse; it returns text, token_count, and document_type without selecting a model.
  • Supply file_data (a base64 data URL) or file_url. file_id is not supported.
  • The model must advertise supports_file_attachments; otherwise model does not support file attachments.
  • Images are not parsed here. See Image Input.

Accepted Kinds

Text, PDF, DOCX, PPTX, XLSX, XLS. Anything else: file type is not supported for server-side parsing. Scanned or image-only PDFs have no text to extract.

Limits

  • Inline attachments: 1 MiB decoded; use file_url for larger. Chat request body: 64 MiB.
  • PDF parsing: isolated process, 10-second timeout, 2,000 pages, 50 MiB extracted text.
  • A safety limit fails the request with a sanitized error rather than a shortened document.
Bytes, filenames, and extracted text are request-local.

PDF and Document Input

Attaching files.

Server-Side Tools

Overview.

Image Input

Images in chat.