> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trynito.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# File Parser

> Text extraction from attached documents.

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`](/api/api-reference/server-tools/file-parser#standalone-document-parsing); it returns `text`, `token_count`, and `document_type` without selecting a model.

```bash wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://app.trynito.ai/v1/chat/completions \
  -H "Authorization: Bearer $NITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonshotai/kimi-k3",
    "messages": [
      {
        "role": "user",
        "content": [
          { "type": "text", "text": "Summarize this document." },
          { "type": "file", "file": { "filename": "report.pdf", "file_data": "data:application/pdf;base64,JVBERi0xLjcK..." } }
        ]
      }
    ]
  }'
```

* 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](/api/features/multimodal/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.

## Related

<CardGroup cols={3}>
  <Card title="PDF and Document Input" icon="file-pdf" href="/api/features/multimodal/pdf-input">
    Attaching files.
  </Card>

  <Card title="Server-Side Tools" icon="toolbox" href="/api/features/server-side-tools">
    Overview.
  </Card>

  <Card title="Image Input" icon="image" href="/api/features/multimodal/image-input">
    Images in chat.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.