> ## 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.

# PDF and Document Input

> Attach PDFs and office documents to a chat message.

Attach a document as a `file` content part and Nito parses it into text before the model runs. Supported: **PDF, DOCX, PPTX, XLSX, XLS, and plain text**. Images take a different path: [Image Input](/api/features/multimodal/image-input).

## The File Part

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "role": "user",
  "content": [
    { "type": "text", "text": "Summarize the key obligations in this contract." },
    {
      "type": "file",
      "file": {
        "file_url": "https://static.example.org/contract.pdf",
        "filename": "contract.pdf"
      }
    }
  ]
}
```

* `file_url`: an `https` URL with no credentials and no private or loopback host, or
* `file_data`: the bytes inline, with
* `filename`: helps the parser identify the kind.

`file` and `input_file` are both accepted as the part type. There is no `file_id`; supply the document on each request.

```bash 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": "List every payment deadline in this PDF." },
          { "type": "file", "file": { "file_url": "https://static.example.org/contract.pdf", "filename": "contract.pdf" } }
        ]
      }
    ]
  }'
```

## Limits

| Cap | Value |
| - | - |
| Pages parsed | 2,000 |
| Parse timeout | 10 seconds |
| Extracted text | 50 MiB |
| Inline `file_data` | 1 MiB decoded; use `file_url` for larger documents |

A document that hits a limit fails with a sanitized error rather than returning a shortened document. Split very large PDFs first.

## Related

<CardGroup cols={2}>
  <Card title="Multimodal" icon="cubes" href="/api/features/multimodal">
    Overview.
  </Card>

  <Card title="File Parser" icon="square-code" href="/api/features/server-side-tools/file-parser">
    How parsing works.
  </Card>

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

  <Card title="How the API Works" icon="gears" href="/api/get-started/how-nito-works">
    The request lifecycle.
  </Card>
</CardGroup>

## Extract text without inference

Upload a multipart `file` to [`POST /api/v1/attachments/parse`](/api/api-reference/server-tools/file-parser#standalone-document-parsing). The API returns extracted text, a model-independent token estimate, and the document type. No model ID is required; document parsing is billed separately.


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