---
title: "Parse Bytes"
method: POST
path: "/parse"
tags: ["Parsing"]
---

# Parse Bytes

`POST /parse`

Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.

## Query parameters

- `extension` 'txt' | 'text' | 'md' | 'markdown' | 'html' | 'htm' | 'xhtml' | 'xml' | 'rss' | 'atom' | 'csv' | 'tsv' | 'yaml' | 'yml' | 'py' | 'java' | 'js' | 'jsx' | 'mjs' | 'cjs' | 'json' | 'jsonl' | 'ndjson' | 'php' | 'sh' | 'bash' | 'zsh' | 'fish' | 'rb' | 'ts' | 'tsx' | 'rtf' | 'srt' | 'css' | 'scss' | 'less' | 'styl' | 'sass' | 'svg' | 'pdf' | 'docx' | 'doc' | 'xlsx' | 'xlsm' | 'xlsb' | 'xltx' | 'xltm' | 'xls' | 'pptx' | 'pptm' | 'ppsx' | 'ppsm' | 'potx' | 'potm' | 'ppt' | 'pps' | 'pot' | 'jpg' | 'jpeg' | 'jpe' | 'png' | 'gif' | 'bmp' | 'tiff' | 'tif' | 'webp' | 'ppm' | 'pbm' | 'pgm' | 'pnm' — Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.
- `includeLinks` union — Preserve hyperlinks in Markdown output
  - boolean
  - 'true' | 'false'
- `includeImages` union — Include image references in Markdown output
  - boolean
  - 'true' | 'false'
- `shortenBase64Images` union — Shorten base64-encoded image data in the Markdown output
  - boolean
  - 'true' | 'false'
- `useMainContentOnly` union — Extract only the main content from HTML-like inputs
  - boolean
  - 'true' | 'false'
- `ocr` union — When true for PDF inputs, detect and OCR images embedded in the selected pages, inserting recognized text at each image's position in page reading order while preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. When false, all OCR is disabled, including the automatic scanned-PDF fallback.
  - boolean
  - 'true' | 'false'
- `pdf` object — PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
  - `start` integer — First 1-based PDF page to parse. When omitted, parsing starts at the first page.
  - `end` integer — Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.
- `client` string — Optional client identifier used for usage attribution.
- `zdr` 'enabled' | 'disabled' — Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
- `tags` string[] — Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

## Response `200`

Successful response

- object
  - `success` true, required — Indicates success
  - `markdown` string, required — Input bytes converted to GitHub Flavored Markdown
  - `type` 'html' | 'xml' | 'json' | 'jsonl' | 'text' | 'csv' | 'tsv' | 'markdown' | 'yaml' | 'python' | 'java' | 'javascript' | 'php' | 'shell' | 'ruby' | 'typescript' | 'rtf' | 'srt' | 'css' | 'scss' | 'less' | 'stylus' | 'sass' | 'svg' | 'pdf' | 'docx' | 'doc' | 'xlsx' | 'xls' | 'pptx' | 'ppt' | 'jpg' | 'png' | 'gif' | 'bmp' | 'tiff' | 'webp' | 'ppm' | 'pbm' | 'pgm' | 'pnm', required — Detected content type used for parsing
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `400` — Invalid input or no parseable content
- `413` — Request body exceeds the 25 MiB upload limit
- `415` — Unsupported content type
- `500` — Internal server error

## Changes

- **2026-07-21** `3764d9c86493` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/context/apis/context-dev/changes/parse/post.md)

---

[API](https://skmtc.dev/context/apis/context-dev.md) · [All operations](https://skmtc.dev/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/context/context-dev/revisions/00e371f8c2a5/schema)
