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

> How document content reaches a model.

Documents reach a model as a `file` content part on chat completions, Responses, or Messages. The gateway extracts the text request-locally and keeps neither the file nor the text. Accepted: text, PDF, DOCX, PPTX, XLSX, XLS. See [PDF and document input](/api/api-reference/multimodal/pdf-input).

## Related

* [PDF and document input](/api/api-reference/multimodal/pdf-input)
* [Image input](/api/api-reference/multimodal/image-input)

## Standalone document parsing

`POST /api/v1/attachments/parse` extracts text without calling a model. Authenticate with an API key or an OAuth bearer with `cli:inference`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://app.trynito.ai/api/v1/attachments/parse \
  -H "Authorization: Bearer $NITO_API_KEY" \
  -F 'file=@report.pdf'
```

Send a multipart upload with only the `file` field. Let your HTTP client set the multipart boundary. Do not send `model`, `trust_tier`, or `parse_mode`.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "text": "Quarterly report",
  "token_count": 4,
  "document_type": "pdf"
}
```

`token_count` estimates tokens as the extracted UTF-8 byte length divided by four, rounded up. It is independent of the model tokenizer. Accepted formats are text, PDF, DOCX, PPTX, XLSX, and XLS. Scanned PDFs without embedded text have no text to extract.

Each successful parse is billed as one document-parse unit. Funding and spend caps are checked before processing. The file and extracted text are request-local; the response uses `Cache-Control: no-store`. There is no stored file ID to reuse.

See the [parse endpoint](/api/api-reference/endpoints/documents/parse) for the multipart schema and errors.


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