Thanks to visit codestin.com
Credit goes to docs.context.dev

Skip to main content
POST
Parse Bytes
1 Credit OCR: +1 Credit per recovered page

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <API_KEY>, where <API_KEY> is your api key.

Query Parameters

extension
enum<string>

Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.

Available options:
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

Preserve hyperlinks in Markdown output

includeImages
boolean
default:false

Include image references in Markdown output

shortenBase64Images
boolean
default:true

Shorten base64-encoded image data in the Markdown output

useMainContentOnly
boolean
default:false

Extract only the main content from HTML-like inputs

ocr
boolean
default:false

When true for PDF inputs, OCR the selected pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.

pdf
object

PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.

client
string

Optional client identifier used for usage attribution.

Required string length: 1 - 100
zdr
enum<string>
default: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 [email protected]), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.

Available options:
enabled,
disabled
tags
string[]

Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 characters. Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Maximum array length: 20
Required string length: 1 - 50
Example:

Body

Raw file bytes. The request body must not exceed 25 MiB.

The body is of type file.

Response

Successful response

success
enum<boolean>
required

Indicates success

Available options:
true
markdown
string
required

Input bytes converted to GitHub Flavored Markdown

type
enum<string>
required

Detected content type used for parsing

Available options:
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
request_id
string<uuid>
required

Unique id of this API call, also sent in the X-Request-Id response header. Quote it when contacting support about a failed request.

Example:

"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"

key_metadata
object

Credit usage, included whenever a valid API key is provided.