[Go to site: main page, start]

Skip to main content
POST
JavaScript
1 Credit OCR: 5 Credits

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
includeLinks
default:true

Preserve hyperlinks in Markdown output

includeImages
default:false

Include image references in Markdown output

shortenBase64Images
default:true

Shorten base64-encoded image data in the Markdown output

useMainContentOnly
default:false

Extract only the main content from HTML-like inputs

ocr
default:false

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.

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[]

Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. 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
key_metadata
object

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.