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

# Parameters

> Complete reference for public conversion parameters.

# Parameters

All conversion endpoints share the same public parameters. In `POST /convert` and `POST /convert/raw` they go in the query string; in `POST /convert/from-url` they can go in the JSON body or query string.

## Common parameters

<ParamField query="filename" type="string" default="document.pdf">
  Document name. It helps detect the format and names the output. Used by `/convert/raw` and `/convert/from-url`.
</ParamField>

<ParamField query="input_format" type="enum" default="auto">
  Force input format. With `auto`, the API detects it from filename and content type.
</ParamField>

<ParamField query="mode" type="enum" default="fast">
  Conversion strategy: `fast`, `balanced`, `quality`, or `auto`. See [Modes](/docs/concepts/modes).
</ParamField>

<ParamField query="clean" type="boolean" default="true">
  Cleans repeated headers, control lines and excess line breaks.
</ParamField>

<ParamField query="response_format" type="enum" default="markdown">
  `markdown` returns the Markdown body. `json` returns structured metadata with the Markdown. See [Response](/docs/api/response).
</ParamField>

## Streaming-only parameters

`POST /convert/stream` accepts, in addition to `filename`, `input_format`, `clean` and `slim`:

<ParamField query="stream_slim_strategy" type="enum" default="sampled">
  How repeated headers and footers are reduced when `slim=true`:

  * `off`: fastest first byte, minimal cleanup.
  * `sampled`: default balance for long PDFs.
  * `full`: best cleanup, higher startup time.

  A value outside `{off, sampled, full}` returns `400`.
</ParamField>

## `input_format` values

| Value  | Format                                |
| ------ | ------------------------------------- |
| `auto` | Automatic detection.                  |
| `pdf`  | PDF.                                  |
| `docx` | Word.                                 |
| `xlsx` | Excel.                                |
| `pptx` | PowerPoint.                           |
| `csv`  | CSV.                                  |
| `txt`  | Plain text.                           |
| `html` | HTML.                                 |
| `zip`  | ZIP with a supported document inside. |

See [Supported formats](/docs/concepts/formats).

## `mode` values

| Mode       | Usage                                                      |
| ---------- | ---------------------------------------------------------- |
| `fast`     | Recommended default for most files and AI-agent pipelines. |
| `balanced` | Better structure for irregular documents and tables.       |
| `quality`  | Slower, best-effort mode for difficult documents.          |
| `auto`     | Starts fast and uses a stronger path only when needed.     |

## Output to your storage

<ParamField query="output_url" type="string">
  Pre-signed `PUT` URL from your storage. If provided, the API uploads the converted Markdown there and returns a small JSON response instead of returning the full Markdown body.
</ParamField>

<ParamField query="output_encoding" type="enum" default="identity">
  Compression for uploaded Markdown: `identity`, `gzip`, or `zstd`. See [Compression](/docs/concepts/compression).
</ParamField>

<ParamField query="output_head_url" type="string">
  Pre-signed `HEAD` URL used to check whether the output already exists before converting again.
</ParamField>

## Precedence in `from-url`

In `POST /convert/from-url`, if a parameter arrives both by query and JSON body, the query value wins. Missing values use the body value or the default.
