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

# Document Processing

> Extract text and token counts from documents with the Venice Text Parser API, then reuse the output in prompts, embeddings, and data pipelines.

The Text Parser API extracts text from a document without running model inference. Use it when your application needs to inspect, store, index, or reuse document content before sending it to a model.

Supported inputs include PDF, DOCX, PPTX, XLSX, and plain text files up to 25 MB.

## Parse a Document

Upload the file as `multipart/form-data`:

```bash theme={"system"}
curl https://api.venice.ai/api/v1/augment/text-parser \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -F "file=@document.pdf" \
  -F "response_format=json"
```

The default `json` response format returns the extracted text and its token count. Use `response_format=text` when you only need the extracted text.

## Text Parser or Chat File Input?

Both features extract document content, but they serve different workflows:

| Need                                         | Use                                             |
| -------------------------------------------- | ----------------------------------------------- |
| Ask a model about a document immediately     | [Chat file input](/guides/features/file-inputs) |
| Extract text without inference               | Text Parser                                     |
| Check token count before choosing a model    | Text Parser                                     |
| Store, index, or reuse extracted content     | Text Parser                                     |
| Use the same document across several prompts | Text Parser                                     |

## Typical Pipeline

<Steps>
  <Step title="Parse the file">
    Upload the source document and request a JSON response.
  </Step>

  <Step title="Inspect the output">
    Check the token count against the target model's context window. Trim or split large documents before inference.
  </Step>

  <Step title="Use the text">
    Add it to a chat prompt, generate embeddings for retrieval, or save it in your own data store.
  </Step>
</Steps>

<Info>
  Parsing runs in memory with zero data retention. Venice processes the uploaded document and immediately discards it without storing or logging its content.
</Info>

<Warning>
  The Text Parser API is experimental. Its request and response format may change without notice.
</Warning>

## Related Resources

* [Text Parser API Reference](/api-reference/endpoint/augment/text-parser)
* [File Inputs](/guides/features/file-inputs)
* [Embeddings](/guides/features/embeddings)
* [Text Models](/models/text)
