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

# POST /convert/raw

> Upload a document directly and receive Markdown.

# POST /convert/raw

Converts a document sent directly in the request body.

## Request

```http theme={null}
POST /convert/raw?filename=report.pdf&mode=fast HTTP/1.1
x-api-key: YOUR_API_KEY
content-type: application/pdf
```

The body is the binary document.

## Query params

| Param             | Type    | Default        | Description                                                 |
| ----------------- | ------- | -------------- | ----------------------------------------------------------- |
| `filename`        | string  | `document.pdf` | Helps detect the format.                                    |
| `input_format`    | enum    | `auto`         | `pdf`, `docx`, `csv`, `txt`, `html`, `xlsx`, `pptx`, `zip`. |
| `mode`            | enum    | `fast`         | `fast`, `balanced`, `quality`, `auto`.                      |
| `clean`           | boolean | `true`         | Cleans repeated headers and noise.                          |
| `response_format` | enum    | `markdown`     | `markdown` or `json`.                                       |

## Raw upload size limit

`POST /convert/raw` is best for small and medium files that your app already has in memory. For large files, upload to S3, R2, Supabase Storage, GCS, Azure Blob or another signed storage URL, then call [`/convert/from-url`](/docs/api/convert-from-url).

The raw upload limit is enforced before conversion. If the document is too large, the API returns `413` with a safe JSON error and a recommendation to use signed storage URLs.

## Example with gzip

```bash theme={null}
gzip -c report.pdf > report.pdf.gz

curl -X POST "https://api.markpdf.tech/convert/raw?filename=report.pdf" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/pdf" \
  -H "content-encoding: gzip" \
  --data-binary "@report.pdf.gz"
```

## Example with zstd

```bash theme={null}
zstd -T0 -3 report.pdf -o report.pdf.zst

curl -X POST "https://api.markpdf.tech/convert/raw?filename=report.pdf" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/pdf" \
  -H "content-encoding: zstd" \
  --data-binary "@report.pdf.zst"
```

Zstd usually decompresses quickly with a good ratio. For very large files, prefer `/convert/from-url` instead of sending the whole file through your application server.
