This endpoint is used to submit a PDF file for conversion to markdown. A PDF file must be uploaded, and the X-API-Key header must be set to the team’s API key. file is the PDF file to be converted to markdown. Returns the converted markdown file and base64 encoded image files.
Optional file URL (http/https). If provided, the server will download and process it.
Which output mode to use. Valid values: 'fast' (lowest latency, great for real-time use cases), 'balanced' (balanced accuracy and latency, works well with most documents), 'accurate' (highest accuracy and latency, good on the most complex documents).
The maximum number of pages in the PDF to convert.
The page range to parse, comma separated like 0,5-10,20. This will override max_pages if provided. Example: '0,2-4' will process pages 0, 2, 3, and 4.
Note: This parameter has been deprecated, and will be ignored in the current version. The languages to use if OCR is needed, comma separated. Must be either the names or codes from https://github.com/datalab-to/surya/blob/master/surya/languages.py. Any other inputs will be ignored.
[DEPRECATED] This parameter is deprecated and has no effect. OCR is handled automatically by the parsing pipeline.
[DEPRECATED] This parameter is deprecated and has no effect. Line formatting is handled automatically by the parsing pipeline.
Whether to paginate the output. Defaults to False. If set to True, each page of the output will be separated by a horizontal rule that contains the page number (2 newlines, {PAGE_NUMBER}, 48 - characters, 2 newlines).
Add data-block-id attributes to HTML elements for citation tracking. Only applies when output_format includes 'html'.
[DEPRECATED] This parameter is deprecated and has no effect. OCR handling is managed automatically by the parsing pipeline.
Disable image extraction from the PDF. If use_llm is also set, then images will be automatically captioned. Defaults to False.
Disable synthetic image captions/descriptions in output. Images will be rendered as plain img tags without alt text or the img-description wrapper div. Defaults to False.
[DEPRECATED] This parameter is deprecated and has no effect. Math recognition is handled automatically by the parsing pipeline.
[DEPRECATED] This parameter is deprecated. Use the 'mode' parameter instead: 'balanced' or 'accurate' modes.
The output format for the text. Can be 'json', 'html', 'markdown', or 'chunks'. Defaults to 'markdown'. You can comma separate multiple formats, like markdown,html.
Skip the cache and re-run the inference. Defaults to False. If set to True, the cache will be skipped and the inference will be re-run.
Save the checkpoint after processing. Defaults to False. This is only useful if you're applying custom rules iteratively.
[DEPRECATED] This parameter is deprecated and has no effect. Block correction is not currently supported.
The schema to use for structured extraction (only used with structured extraction endpoint). The ideal way to generate this is to create a Pydantic schema, then convert to JSON with .model_dump_json().
The schema to use for document segmentation. Should be a JSON string containing segment names and descriptions for identifying page ranges of different document sections.
Additional configuration options as a JSON string. Only these keys have effect: 'keep_pageheader_in_output' (bool), 'keep_pagefooter_in_output' (bool), 'keep_spreadsheet_formatting' (bool).
Optional workflow step data ID. If provided, this request will be associated with the specified workflow step execution.
Comma-separated list of extra features to enable. Currently supports: 'track_changes', 'chart_understanding', 'table_row_bboxes', 'extract_links', 'infographic', 'new_block_types'.
Optional webhook URL to call when the request is complete. If provided, this will override the webhook URL stored in your account settings for this specific request.
Input PDF, word document, powerpoint, or image file, uploaded as multipart form data. Images must be png, jpg, or webp format.
Successful Response
The ID of the request. This ID can be used to check the status of the request.
The URL to check the status of the request and get results.
Whether the request was successful.
If the request was not successful, this will contain an error message.
A dictionary of the versions of the libraries used in the request.