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

# Response and headers

> Markdown or JSON body and observability headers.

# Response and headers

## Markdown (default)

With `response_format=markdown` you receive the converted document as a raw body:

```http theme={null}
HTTP/1.1 200 OK
content-type: text/markdown; charset=utf-8
content-disposition: attachment; filename="report.md"
```

## JSON

With `response_format=json` you receive an object with the Markdown and its metadata:

```json theme={null}
{
  "filename": "report.pdf",
  "input_format": "pdf",
  "markdown": "# Informe...\n\n...",
  "size_bytes": 184320,
  "timings": {
    "convert_ms": 142,
    "clean_ms": 3,
    "total_worker_ms": 145,
    "upload_ms": 20,
    "total_request_ms": 171
  },
  "markdown_bytes": 5120,
  "token_saved_estimate": 44800
}
```

<ResponseField name="markdown" type="string">
  Document converted to Markdown.
</ResponseField>

<ResponseField name="input_format" type="string">
  Detected or forced format of the input.
</ResponseField>

<ResponseField name="engine" type="string" />

<ResponseField name="size_bytes" type="integer">
  Size of the processed document in bytes.
</ResponseField>

<ResponseField name="timings" type="object">
  Times in milliseconds: `convert_ms`, `clean_ms`, `total_worker_ms`, `upload_ms`, `total_request_ms`.
</ResponseField>

<ResponseField name="markdown_bytes" type="integer">
  Size of the output Markdown in bytes.
</ResponseField>

<ResponseField name="token_saved_estimate" type="integer">
  Estimation of tokens saved versus entering the raw document into the prompt.
</ResponseField>

## Headers

Every response includes observability headers, useful for logging and metrics in your client.

| Header                   | Meaning                                                             |
| ------------------------ | ------------------------------------------------------------------- |
| `X-Conversion-Engine`    | Used conversion engine.                                             |
| `X-Input-Format`         | Detected input format.                                              |
| `X-Input-Bytes`          | Bytes of the processed document.                                    |
| `X-Wire-Bytes`           | Bytes received over network (`/convert/raw` with compression only). |
| `X-Markdown-Bytes`       | Output Markdown size.                                               |
| `X-Token-Saved-Estimate` | Estimated tokens saved.                                             |
| `X-Conversion-Ms`        | Conversion time.                                                    |
| `X-Total-Request-Ms`     | Total time of the request.                                          |
| `ETag`                   | Hash of the content + parameters. Use it for cache.                 |
| `Cache-Control`          | `public, max-age=..., immutable`.                                   |

See [Cache and ETag](/docs/concepts/caching).
